/ Published in: jQuery
URL: http://www.nealgrosskopf.com/tech/thread.php?pid=77
Ever notice how fast images load when paging through a Facebook photo album? Facebook is preloading each of these images into your browser's cache before you even view them. Learn how to accomplish this using a couple lines of jQuery.
Expand |
Embed | Plain Text
var nextimage = "/images/some-image.jpg"; $(document).ready(function(){ window.setTimeout(function(){ var img = $("<img>").attr("src", nextimage).load(function(){ //all done }); }, 100); });
You need to login to post a comment.
