Forums | MacLife
You are not logged in.
#1 2006-05-25 2:23 pm
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
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
