第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

Cannot read property 'order' of undefined (48)/ Cannot read property 'length' of undefined (7)

//圖片預(yù)加載插件
(function($){????//閉包傳遞參數(shù)
function?Preload(imgs,?options)?{
var?imgs?=?(typeof?imgs?===?'string')???[imgs]?:?imgs;??//傳入對象為字符串
var?opts?=?$.extend({},?Preload.DEFAULTS,?options);?????//將默認(rèn)的參數(shù)和傳遞進(jìn)來的參數(shù)合并-->后者覆蓋前者

if?(this.opts.order?===?'ordered')?{??????//判斷使用有序還是無序???<--?這里為什么讀不到order呢?
this._oredered();
}?else?{
this._unordered();
}
//?this._unordered();
}
Preload.DEFAULTS?=?{
order:?'unordered',?//默認(rèn)使用無序預(yù)加載
each:?null,?//?每一張圖片加載完成
all:?null?//所有圖片加載完成
};
Preload.prototype._oredered?=?function?()?{????//有序預(yù)加載
var?imgs?=?this.imgs,
opts?=?this.opts,
count=?0,
len?=?imgs.length;??????//<--這里??imgs怎么傳遞的?我這里是undefined

sortPreLoad();
function?sortPreLoad?()?{
var?imgObj?=?new?Image();

$(imgObj).on('load?error',?function?()?{
opts.each?&&?opts.each(count);?????????//存在each方法,傳入count??????
if(count?>=?len?-?1)?{????//如果圖片加載完成
opts.all?&&?opts.all();
}?else?{
sortPreLoad();
}
count++;
});
imgObj.src?=?imgs[count];
};
}
Preload.prototype._unordered?=?function?()?{?//無序加載
var?imgs?=?this.imgs,
opts?=?this.opts,
count?=?0;
alert(this.imgs)
var?len?=?imgs.length;


$.each(imgs,?function?(i,?src)?{
if(typeof?src?!=?'string'){
return?;
}
var?imgObj?=?new?Image();

$(imgObj).on('load?error',?function?()?{
opts.each?&&?opts.each(count);
if(count?>=?len?-1)?{
opts.all?&&?opts.all();
}
count++;
});
imgObj.src?=?src;
});
};

$.extend({
preload:?function?(imgs,?opts)?{
new?Preload(imgs,?opts);
}
});

})(jQuery)

preload.js:48 Uncaught TypeError: Cannot read property 'length' of undefined ? ?

at Preload._unoredered (preload.js:48) ? ?

at new Preload (preload.js:12) ? ?

at Function.preload (preload.js:72) ? ?

at index.html:100

-----

preload.js:7 Uncaught TypeError: Cannot read property 'order' of undefined ? ?

at new Preload (preload.js:7) ? ?

at Function.preload (preload.js:70) ? ?

at index1.html:74

正在回答

1 回答

http://img1.sycdn.imooc.com//591d847500014aef08250248.jpg

這不是已經(jīng)告訴你錯誤在哪了嗎?

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
圖片預(yù)加載
  • 參與學(xué)習(xí)       40976    人
  • 解答問題       88    個

預(yù)知發(fā)生的行為,提前加載需要的圖片,獲得更好的用戶體驗(yàn)

進(jìn)入課程

Cannot read property 'order' of undefined (48)/ Cannot read property 'length' of undefined (7)

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號