Quantcast

Forums | MacLife

You are not logged in.

#1 2006-05-25 2:23 pm

iZach004
Member
From: Indianapolis, IN, 46240
Registered: 2001-06-04
Posts: 176
Website

Image Preloading with Status Bar

I'm working on a site with a lot of images and it would be helpful to preload them. Scripting a status bar isn't a problem; my main setback lies with preloading the images themselves:

1. How do I tell the browser to preload a specific image
2. How does the browser tell me that the image has been loaded. Is there some sort of a callback?

Thanks, any help would be greatly appreciated.

Offline

 

#2 2006-05-25 9:51 pm

Miles
Now I fight for wisdom!
Administrator
From: Michigan
Registered: 2001-07-21
Posts: 4506
Website

Re: Image Preloading with Status Bar

Preloading is easy, create an Image object and set the src property to the URL of the image.  Google it and you'll find a million tutorials.  As for the second, set the onload handler of the image object.

Offline

 

Board footer

Powered by PunBB 1.2.6
© Copyright 2002–2005 Rickard Andersson