August 04, 2001

One good thing to look at when creating image rollovers is the pre-load function. This will help eliminate the time it takes for the images to swap out during onMouseover and onMouseout events. Even though all the images get loaded during the initial visit it takes no time to swap them due to the fact they are in cache.

You can use this for as many images as needed.

The following code needs to be placed in the <head> section of the page with the rollovers:

image1 = new Image();
image1.src = "image1.gif";


image2 = new Image();
image2.src = "image2.gif";