Load Images Before Application Start | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Load Images Before Application Start

I have multiple images to be loaded and I want to load them all before displaying them. How can i do that with JS.

7th Apr 2019, 10:23 AM
Alquen
Alquen - avatar
2 Answers
+ 6
Count in load event listener of images, and call the callback function when counter reaches total number of images. https://code.sololearn.com/Wugdyk32iG41/?ref=app
7th Apr 2019, 10:34 AM
Gordon
Gordon - avatar
0
@Gordon Big thanks man
7th Apr 2019, 10:47 AM
Alquen
Alquen - avatar