Created
April 22, 2015 08:46
-
-
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 !!!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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