diff --git a/a.txt b/a.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/extend/layer.ext.js b/src/extend/layer.ext.js index ee80436..ce9f3b1 100644 --- a/src/extend/layer.ext.js +++ b/src/extend/layer.ext.js @@ -134,10 +134,11 @@ layer.photos = function(options, loop, key){ }; //下一张 - dict.imgnext = function(key){ + dict.imgnext = function(key,errorMsg){ dict.imgIndex++; if(dict.imgIndex > data.length){ dict.imgIndex = 1; + if (errorMsg) {return}; } dict.tabimg(key) }; @@ -194,7 +195,7 @@ layer.photos = function(options, loop, key){ callback(img); }; img.onerror = function(e){ - img.onload = null; + img.onerror = null; error(e); }; img.src = url; @@ -247,7 +248,7 @@ layer.photos = function(options, loop, key){ }, function(){ layer.close(dict.loadi); layer.msg('当前图片地址异常', {time: 2000}, function(){ - data.length > 1 && dict.imgnext(true); + data.length > 1 && dict.imgnext(true,true); }); }); };