/ Published in: jQuery
This script preloads images in your document or lets your to preload images by their url and insert or append them in your DOM tree later.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Insert preloaded image after it finishes loading $('<img />') .attr('src', 'imageURL.jpg') .load(function(){ $('.profile').append( $(this) ); // Your other custom code });
URL: http://jquery-howto.blogspot.com/2009/02/preload-images-with-jquery.html