/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript" charset="utf-8"> // JQUERY WAY TO PRELOAD IMAGES // DOES NOT NEED TO BE IN DOCUMENT READY $.preloadImages = function() { for(var i = 0; i<arguments.length; i++) { img = new Image(); img.src = arguments[i]; } } $.preloadImages( "path/to/image/1", "path/to/image/2", "path/to/image/3" ); </script>