Created
March 26, 2009 22:39
-
-
Save tdreyno/86408 to your computer and use it in GitHub Desktop.
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 preloadCount = 0; | |
| function preloadEvent() { | |
| preloadCount++; | |
| if (preloadCount >= 2) { | |
| // Show the images | |
| } | |
| } | |
| var image1 = new Image(); | |
| image1.onload = preloadEvent; | |
| var image2 = new Image(); | |
| image2.onload = preloadEvent; | |
| image1.src = "/images/image1.jpg"; | |
| image2.src = "/images/image2.jpg"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment