JavaScript waiting until an image is fully loaded before continuing script

前端 未结 3 1337
太阳男子
太阳男子 2021-01-17 09:56

I\'ve been looking around a lot of JavaScript answers but I haven\'t found one that really answers my problem yet. What I\'m trying to do is load an image, grab the pixel da

3条回答
  •  遥遥无期
    2021-01-17 10:53

    Actually...a lot of developers are pointing here to detect when images are done loading after a jQuery event..

    https://github.com/desandro/imagesloaded

    If you can determine when the event triggers your images to load (for example, adding an Id or class onto the page right before your images begin to load), then you should be able to blend that in with this plug-in on github.

    Good Luck!

提交回复
热议问题