Created
September 28, 2014 09:35
-
-
Save angusjune/dea674efd3dea3742b34 to your computer and use it in GitHub Desktop.
Image Preload
This file contains hidden or 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
var preload = ['1.png', '2.png', '3.png']; | |
var images = []; | |
for (var i = 0; i < preload.length; i++) { | |
images[i] = new Image(); | |
images[i].src = prelaod[i]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
thank for this gist 👍 , but there is an error in the last line images[i].src = prelaod[i];
prelaod[i] should be preload[i]