[removed] Know when an image is fully loaded

前端 未结 7 1156
旧巷少年郎
旧巷少年郎 2020-11-30 02:42

If I have a beacon:


I want a method to be called once the beacon request finishes. Somethin

7条回答
  •  一生所求
    2020-11-30 03:20

    Sure. Remember the load needs to be added before the src attribute.

    $('').load( function(){
      console.log('loaded');
    }).attr('src', imgUrl);
    

    If you have defined the image tag in the markup then your stuck with when the window load event fires to be sure the image has come down the wire.

提交回复
热议问题