Wait for images to load and then execute all other code

后端 未结 6 1628
广开言路
广开言路 2021-02-14 14:24

OK, I\'m losing my mind over this. I did read here at SO and google about it, I even have the preloader set (found here on SO), but none of the plugins/code I found helped me. <

6条回答
  •  粉色の甜心
    2021-02-14 15:14

    Instead of trying to preload, you could just execute your script on...

    window.onload = function(){..}
    

    That doesn't fire until all images have been loaded.

提交回复
热议问题