Created
July 23, 2018 14:44
-
-
Save niksudan/bcdbd2f8c83dfc2c4f62a912d4431b80 to your computer and use it in GitHub Desktop.
Preload an image without rendering
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
const image = new Image(); | |
image.src = 'your-image-url-here'; | |
image.onload = () => { | |
// Your image has loaded | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment