To get this going, you need to have a small section of script in the HEAD section of your page. Here is a sample of a script that preloads a single image:
The first command defines a new image object, giving it a width of 100 and a height of 25. You would replace these with the width and height of your image. The second defines the url or web address of the image. You would replace this with the url of your image. Not too bad now, is it?
There, now you have the code to preload (what a rhyme!). If you want to do this for multiple images, just be sure to assign them a different name-- such as pic2, pic3, and so on. Adjust your width, height, and urls accordingly. You will have two lines for each image. For example, to preload three images, you would use a code like this:
In the next section you will see an example of how preloading works with the image rollover script. The first section will use browser detection, while the following sections will use object detection like we did here.
Well, that does it for now, Let's go on to the next section,
||By: John Pollock||