jQuery check if image is loaded

前端 未结 2 515
旧巷少年郎
旧巷少年郎 2021-01-21 08:01

I need help with the following code which doesn\'t work:

var timeoutID=0;
var currentImage=0;//first image is position 0 in arrImages array
var arrImages=[bla bla bla         


        
2条回答
  •  日久生厌
    2021-01-21 08:34

    If I remember correctly the image gets the width and height when it gets loaded. So I guess you could check the width if the image. And as long as that is 0 the image is not loaded.

提交回复
热议问题