Skip to content

Instantly share code, notes, and snippets.

@terehof
Created April 22, 2015 08:46
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 terehof/511d66fe2fd19fadf1c1 to your computer and use it in GitHub Desktop.
Save terehof/511d66fe2fd19fadf1c1 to your computer and use it in GitHub Desktop.
Very easy way to preload images which are needed later (e.g. when a hover is performed) (from css-tricks.com !!!)
$.preloadImages = function() {
for (var i = 0; i < arguments.length; i++) {
$("<img />").attr("src", arguments[i]);
}
}
$.preloadImages("hoverimage1.jpg","hoverimage2.jpg");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment