插件中的源码并没有定义each和all, 就可以直接用吗
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;
function load() {
var imgObj = new Image();
$(imgObj).on('load, error', function () {
opts.each && opts.each(count);
if(count >= len){
//所有图片加载完成
opts.all && opts.all();
} else {
load();
}
count++;
});
imgObj.src = imgs[count];
