Images to cache preloader

Technorealm. The UK web site design company

Free javascript

[One of a collection of free javascripts from www.technorealm.co.uk]

With this Javascript, your images are loaded into memory, but are not seen on the page. This allows you to load as many images as you want to without the viewer knowing.

Why and where would you want to do this?

You would use this to distribute the download time of a series of graphics, across a number of pages. For example, your site may use a 'splash' page with basic details about your company, a logo and some text. Further into the site you may have a catalogue of products or your navigation system using images.

To help the images appear to load extremely fast, use this javascript in the index page (as the viewer is reading the text) to pre-load some of them into the cache memory.

By the way, while you've been reading this, nine off (10kB 'ish) graphics have been loading. Click this link to see how many we managed before you arrived here. Some browsers may not show them instantly.

Simply put the path/name of the images in the appropriate place, adding or taking out as necessary.

<script language="javascript">
<!--  
image1 = new Image();
image1.src = "path/filename1";
image2 = new Image();
image2.src = "path/filename2";
image3 = new Image();
image3.src = "path/filename3";
image4 = new Image();
image4.src = "path/filename4";
image5 = new Image();
image5.src = "path/filename5";
image6 = new Image();
image6.src = "path/filename6";
//add more here as required
 -->
<script>
 

www.technorealm.co.uk UK Web site design and graphics. A free resources site!