DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Preloading Images With JQuery

07.10.2008
| 12309 views |
  • submit to reddit
        Taken from http://www.mattfarina.com/2007/02/01/preloading_images_with_jquery

jQuery.preloadImages = function() {
	for (var i = 0; i < arguments.length; i++) {
		jQuery("<img>").attr("src", arguments[i]);
	}
}
    

Comments

Uzbek Jon replied on Mon, 2009/04/06 - 10:40am

This is a good article on preloading images using jQuery. if you need more detailed explanation please refer to this article http://jquery-howto.blogspot.com/2009/02/preload-images-with-jquery.html