This is a discussion on "Detecting "image loaded successfully"" within the JavaScript Forum section. This forum, and the thread "Detecting "image loaded successfully" are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Detecting "image loaded successfully"
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Detecting "image loaded successfully"
I have a page with content.
Upon a certain action, two images get updated/replaced. Because the images are on another server, it sometimes takes a couple of seconds. * I would like to block specific actions (click on a button/other image) UNTIL the images are loaded. * How do I detect when the images are done loading? Something like readyState, complete, or something? Any advice? Thanks in advance. |
|
|
|
||||
|
Re: Detecting "image loaded successfully"
You need to create a loop and check for
|
|
||||
|
Re: Detecting "image loaded successfully"
Back in my rule breaking days when standards were as important to me as an underwater hair drier, I used to use the 'onload' property on the image tag.
ie.: <img src="/img.gif" onload="alert('Image loaded: '+this.src);"/>
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
Re: Detecting "image loaded successfully"
hehe, are you distancing yourself from that advice then spinal?
|
|
||||
|
Re: Detecting "image loaded successfully"
Damn right! LOL
I would use the technique Ryan showed above, and inorder to 'disable' the functionality, I'd add a div overlay to cover the entire screen.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Last edited by spinal007; Dec 22nd, 2006 at 16:16. |
![]() |
| Tags |
| javascript firefox |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Show "Image" Depends On User "Status"? | Monie | Classic ASP | 6 | Oct 16th, 2007 01:22 |
| "PHP Warning Module 'mysql' already loaded in Unknown on line 0" | GLB | PHP Forum | 1 | Sep 1st, 2007 22:57 |
| ? IS "meta name="robots" content="?" necessary in pages ? | Love2Java | Starting Out | 6 | Aug 8th, 2007 13:48 |
| window.opener.document["nameForm"].getElementById("someid").value; doesnt work | drpompeii | JavaScript Forum | 0 | Feb 17th, 2007 23:09 |