Last active
August 29, 2015 13:55
-
-
Save lonekorean/8756498 to your computer and use it in GitHub Desktop.
Still bad image preloader
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
| // better, but still not good | |
| function imageLoaded(i) { | |
| alert(i); | |
| } | |
| for (var i = 0; i < max; i++) { | |
| var image = new Image(); | |
| image.onload = function () { imageLoaded(i) }; | |
| // more irrelevant stuff here | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment