View Full Version : is preloading images possible ??

02-24-2007, 07:57 PM
Hello friends !!
My Question:
suppose i have to show the photo gallery,
and suppose it has 5 image links
Refer the following:

| Image preview of links 1 -5 goes here here..
Links 1 | 2 | 3 | 4 | 5

when clicked on link1 preview of 1 show appear and similarly up to 5.
What i want to do?
I want to display the images without loading when clicked on the link
and i suppose it can be done using javascript, problem is how to preload the
images so that when the link is clicked image should instatly appear in the preview section.
Is there any idea to perform this ?
I would be very greatful for the soultions.
Thanks in advance to all of YOU !!

02-24-2007, 10:36 PM
The only way to preload images without using Javascript is to include the images in the previous page being displayed. You place them at the very bottom of the page set their width and height to 1 pixel and set visibility:hidden

To do it with Javascript means that the page loads more slowly to start with because all of the images are downloaded at once when the page first loads rather than waiting until they are needed.