I want to pre load my larger images, so the site will "load faster"  You 
shouldn't need to ask why. . .

I am using this extremely simple code

window.addEvent('load', function() {
var preLoadImages = Asset.images([
'images/bgHome.jpg',
'images/topImg-honeymoons.jpg',
'images/services-rightSide.jpg',
'images/topImg-blog.jpg',
'images/topImg-contact.jpg',
'images/topImg-aboutMe.jpg',
'images/bgRealWeddings.jpg'
]);
});

I call it one EVERY page, that way if you land on the site not in the 
home/index page, the images still load ahead of time.

Is there a way to dress it up a bit, so that based on sessions, if the 
images are already cached it will skip them. or would that be unnecessary? 
 I suppose if the images are cached, the browser just loads them, and there 
is no call to the server etc.

Thoughts, maybe an example of a good preload script, mootools or otherwise.

NOTE: the script is called on load, so AFTER the page is up.  Pre loading 
OTHER page images.

Reply via email to