From be97675aede746391a589df4e6498b9253ec0226 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 13 May 2016 16:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E5=B8=A6=E5=9B=BE=E7=89=87=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E5=9B=BE=E7=89=87=E4=B8=8D=E8=AE=A9=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=94=BE=E5=A4=A7=E7=9C=8B!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index aa445f817..c43e0a6a2 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1013,15 +1013,18 @@ function showNormalImage(id) { var image=$(description_images[i]); var _path = getRootPath(); //如果图片是视频图片,不处理。 + if($(image).hasClass("mediaIco")){ var _src = _path+"/"+$(image).attr('src'); $(image).attr('src',_src); return; } - - var element=$("").attr("href",image.attr('src')); - image.wrap(element); - $(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); + var tmpsrc = image.attr('src'); + if (tmpsrc.indexOf('.gif') >= 0 || tmpsrc.indexOf('.jpg') >= 0 || tmpsrc.indexOf('.jpeg') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.bmp') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.BMP') >= 0 || tmpsrc.indexOf('.JPEG') >= 0 || tmpsrc.indexOf('.JPG') >= 0 || tmpsrc.indexOf('.PNG') >= 0 || tmpsrc.indexOf('.GIF') >= 0) { + var element = $("").attr("href", image.attr('src')); + image.wrap(element); + $(image).parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false}); + } } //$('#'+id+' a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); //有图片才将链接变为弹出框 }