Click to See Complete Forum and Search --> : preloading images


leprkn
06-27-2003, 04:47 PM
i have a function "preload()" that preloads images when a page loads. how do i pull these images from the cache once their loaded.

here's an example of the function

function preload() {

pyro
06-27-2003, 04:53 PM
Did you forget you code?

leprkn
06-27-2003, 04:56 PM
dammmit!

function preload() {
<!--
a1 = new Image();
a1.src = "image.gif";
}

-->

there. that's what i meant to have

Jona
06-27-2003, 04:57 PM
That should be:


<!--
function preload(){
a1 = new Image();
a1.src="image.gif";
}
//-->


[J]ona

leprkn
06-27-2003, 05:00 PM
right. so now that i have the image loaded, how do i call it?

leprkn
06-27-2003, 05:05 PM
right. so now that i have the image loaded, how do i call it?

Jona
06-27-2003, 05:05 PM
<img src="file.jpg" onMouseOver="this.src=a1.src" onMouseOut="this.src='file.jpg'">


[J]ona