Skip to content

Instantly share code, notes, and snippets.

@angusjune
Created September 28, 2014 09:35
Show Gist options
  • Save angusjune/dea674efd3dea3742b34 to your computer and use it in GitHub Desktop.
Save angusjune/dea674efd3dea3742b34 to your computer and use it in GitHub Desktop.
Image Preload
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];
}
@Rakonda
Copy link

Rakonda commented Jul 27, 2016

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment