From b59a6aa250d6eb4c7170a49d100c28ca06ee2c02 Mon Sep 17 00:00:00 2001 From: zhe-he <460013464@qq.com> Date: Thu, 17 Sep 2015 13:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlayer.photos=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=9B=BE=E7=89=87=E9=83=BD=E5=8A=A0=E8=BD=BD=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E4=B8=8D=E5=81=9C=E5=BC=B9=E7=AA=97=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extend/layer.ext.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extend/layer.ext.js b/src/extend/layer.ext.js index c72964c..6de8966 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) }; @@ -193,7 +194,7 @@ layer.photos = function(options, loop, key){ callback(img); }; img.onerror = function(e){ - img.onload = null; + img.onerror = null; error(e); }; img.src = url; @@ -244,7 +245,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); }); }); };