Click to See Complete Forum and Search --> : Preloading All Page Images


Albon
04-09-2005, 06:50 AM
Hey Yall how do i preload all the page images
even those to be shown "on mouseover" so that
the page visitor dosent have to waaaaaaaait for
the mouseover event (image change) to occur.
this is the web page address (http://www.geocities.com/sunupshoestt/user.html)

Albon

the tree
04-09-2005, 08:51 AM
Adapt this...<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>1 preloaded mousover</title>
<script type='text/javascript'>
<!--
mrimage = new Image();
mrimage.src = "on.gif";
//-->
</script>
</head>
<body>
<img id='mrimage' src='off.gif' onmouseover='this.src="on.gif";' onmouseout='this.src="off.gif";'>
</body>
</html>

felgall
04-09-2005, 06:11 PM
To preload images using HTML instead of Javascript simply code the images as follows immediately before the </body> tag of the previous page.

<img src="myimg.gif" style="width:0;height:0" width="1" height="1" alt="" />

Albon
04-10-2005, 01:33 AM
Wont this be enough somewhere in the <Body>

<BODY OnLoad="loadImages()">

Im no too good at the javascript thing
bear with me a while Lets say the event
images are (those that show on the mouseover event)
<image5.jpg , image6.jpg , image7.jpg , image8.jpg>
and the images that load with the page normally
<image1.jpg , image2.jpg , image1.jpg , image2.jpg>

OK good actual page in question (http://www.geocities.com/sunupshoestt/user.html)

[Q] how do I get <image5.jpg , image6.jpg , image7.jpg , image8.jpg>
to "preload" so that the delay on "mouseover" is shortened?

or am i worrying abou nothing>

Albon
Novice html guy

the tree
04-10-2005, 05:53 AM
Adapt this...Or I could just do it for you:foo = New Image();
foo.src = 'image5.jpg';
foo.src = 'image6.jpg';
foo.src = 'image7.jpg';
foo.src = 'image8.jpg';

cthurow
04-11-2005, 08:56 AM
Also turn on ur FRCA if you are using Apache. Then add those images into FRCA w/pageload & w/startup. This will allow for much faster image loading.