為什么我的load始終無法觸發(fā)
?$.each(imgs,function(i,src){
? ? ? ? ?
? ? ? ? ? var imgObj=new Image();
? ? ? ? ? ? ??
? ? ? ? ? $(imgObj).on('load',function(){
? ? ? ? ? $pic.html(Math.round((count+1)/len*100)+"%")
? ? ? ? ? console.log(Math.round((count+1)/len*100))
? ? ? ? ? if(count>=len-1){
? ? ? ? ? $('.pic').hide();
? ? ? ? ? }
? ? ? ? ? ? ?count++;
? ? ? ? ?
? ? ? ? ? }) ??
? ? ? ? });
2018-06-25
盡量貼全部代碼,說不定其他地方有錯(cuò)
2018-05-03
我也想問一下,為啥我的load事件不觸發(fā)哇
2017-08-25
你把count++后面的,即倒數(shù)第二行的“})”去掉。打多了吧