A jQuery Script Here is a simple jQuery script to preload the images.
(function($){var cache =[];// Arguments are image paths relative to the current page.
$.preLoadImages =function(){var args_len = arguments.length;for(var i = args_len; i--;){var cacheImage = document.createElement('img');
cacheImage.src = arguments[i];
cache.push(cacheImage);}}})(jQuery)
You'll notice that this isn't anything special to jQuery. You can change the name from $.preLoadImages()
to some other function name and use this outside of jQuery.
To use the preloading make a call like:
jQuery.preLoadImages("image1.gif", "/path/to/image2.png");