I am working on a set of javascript functions to create a sort of slideshow where all the photos are sequentially numbered. However, sometimes there are gaps where there is no image. I want to do something with those gaps to let the user know that they do not have to wait for the image to load but still display a blank image (or the little x-image icon) with the caption as a placeholder. Currently, what happens is that you press a button and nothing happens until you come upon the next image as I am triggering the change of image and caption with an onload event on an internal image object.
Does anyone know how I can check to see if an image exists before I try to load it so that I can change the caption without having to wait for the onload event to trigger? I do not want to have the caption change until I have something else to put on the screen because it it very important that the caption match the correct image at all times.
Any help would be appreciated.
If you want to see what I currently have, you can go
here.
It is designed to work in IE fullscreen mode, have not tested it on anything but IE 6.0.2. Arrow keys move forward and back, '+' moves forward 2 images. There is a gap at number 8, you have to press the button twice to get from image 7 to image 9 instead of seeing a blank page with '0008' at the bottom (what I want to happen).
Jaa.
Does anyone know how I can check to see if an image exists before I try to load it so that I can change the caption without having to wait for the onload event to trigger? I do not want to have the caption change until I have something else to put on the screen because it it very important that the caption match the correct image at all times.
Any help would be appreciated.
If you want to see what I currently have, you can go
here.
It is designed to work in IE fullscreen mode, have not tested it on anything but IE 6.0.2. Arrow keys move forward and back, '+' moves forward 2 images. There is a gap at number 8, you have to press the button twice to get from image 7 to image 9 instead of seeing a blank page with '0008' at the bottom (what I want to happen).
Jaa.