by Scott Clark and Ronnie Moore
First published: January, 1999
We show you how to do it, and even do it for you using our nifty script generator!
Some of the most common questions we're called upon to answer from our readers are "How can I preload some images for use in a mouseover effect?" and "How can I make an image change when the mouse is moved over it?" In this tutorial, we're going to show you how to perform both tasks, and we're even going to provide you with a Preload/Rollover Script Generator, created especially for our readers.
Here's the way it works: As the page is loading the initial images, it also pre-loads the mouseover images. As the mouse is moved over the initial image, the script changes the source for the image to the (new) mouseover image. When the mouse is moved off the image, the script changes the source back to the original image. Simple, yet elegant! This works for and with both Netscape and MSIE browsers, so have phun!