Skip to content

Instantly share code, notes, and snippets.

@zandzpider
Created September 30, 2014 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zandzpider/8798d34833f0b39da4e7 to your computer and use it in GitHub Desktop.
Save zandzpider/8798d34833f0b39da4e7 to your computer and use it in GitHub Desktop.
$(function() {
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}
// Usage:
$(['img1.jpg','img2.jpg','img3.jpg']).preload();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment