Click to See Complete Forum and Search --> : roll over images


tane
03-22-2003, 11:46 PM
IS it possible if i have roll over buttons to make the roll over images load when the web page is loading....so when someone does rollover my button the image loads straight away for the modem users ...e.g the way flash loads everthing first ....Another example I have seen is when u go to a site that has picture agallerys and u click on a thum nail and the larger version loads really quick because it was preloaded with the webpage.......thanks

Nedals
03-23-2003, 01:13 AM
This goes in the <head> section

function preload() {
if (document.images) { // Checks to make sure browser supports the image array
imgA = new Image; imgA.src = "images/imageA.gif";
imgB = new Image; imgB.src = "images/imageB.gif";
imgC = new Image; imgC.src = "images/imageC.gif";
imgD = new Image; imgD.src = "images/imageD.gif";
}
}

<body.... onLoad="preload()">

Allows the page to load, and be visible to users, then loads the rollover images.