jQuery or [removed] Determine when image finished loading

后端 未结 7 952
不思量自难忘°
不思量自难忘° 2020-12-05 10:15

How can I detect when an image has finished loading be it from the server or the browser cache? I want to load various images in the same tag and d

7条回答
  •  春和景丽
    2020-12-05 11:03

    Well, this is quite an old thread I came across yesterday. I'm using backbone.js and require.js and resizing my layout always caused problems with views that contain images.

    So, I needed a way to know when the last image has finished loading to resize the layout. All, mentioned solutions above didn't work in my case. After some hours of more investigation I found the ultimate solution that is working:

    http://desandro.github.com/imagesloaded/

    Hope that helps others as well.

提交回复
热议问题