[Javascript] Image Loaded ?

Tim Makins spindrift at oceanfree.net
Mon Oct 13 02:56:42 CDT 2003


Hi - please look at this little page:
http://www.mapability.com/toggle/toggle.html

As you will see, it shows a simple example of 4 images that can be hidden or
displayed over a background, and their stacking order varied so that the
last image pressed is on top.

When the page is loaded, the 4 images are loaded at the same time.

Now, imagine the same thing, but with 50 images, all quite big. It would be
a real annoyance to have to wait whilst all the images were loaded,
especially if the one you really wanted was image #49.

My question is this: Is there any way that when the button is clicked, I
could check whether the image has been already loaded - if yes, its
displayed, if not I could request the image from the web, and display a
little 'image' loading...' gif.

Tim in Ireland.






More information about the Javascript mailing list