jQuery or [removed] Determine when image finished loading

后端 未结 7 949
不思量自难忘°
不思量自难忘° 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:11

    The onload document's event will fire only after all the elements, images included, have fully loaded.

    The onload 's event will fire after the single image have fully loaded.

    So you can attach a listener to these events, using jQuery objects or DOM's addEventListener (and IE's attachEvent)

提交回复
热议问题