Last active
March 10, 2017 15:03
-
-
Save quawn/8560663 to your computer and use it in GitHub Desktop.
JS: Preload images
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]); | |
} | |
} | |
$(document).ready(function() { | |
$.preloadImages("hoverimage1.jpg","hoverimage2.jpg"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment