Preloading images...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Kyori
Forum Newbie
Posts: 23
Joined: Mon Oct 14, 2002 5:23 am
Contact:

Preloading images...

Post by Kyori »

How do I preload images that when the site loads, it won't have need to fetch the images from the server?

I made a script and it works this way:

Index.htm has 3 frames. It also has script to preload images.

image1 = new Image();
image1.src="images/image1.jpg";

In one of the frames, say middleframe, uses this image.
<img name=img1>
<script>img1.src=image1.src</script>


Everytime middleframe is changed, the image is downloaded again from the server.

Here's my link, http://members.lycos.co.uk/charbelgame

I've got an idea on how to get the map to stay loaded, always but not with the other pics.

thanks
Post Reply