From 0019afad224c3914bbf90af66ce7830882bfded2 Mon Sep 17 00:00:00 2001 From: ppoffice Date: Sat, 15 Oct 2016 09:44:32 +0800 Subject: [PATCH] fix: do not wrap img that already included in a link --- source/js/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/js/main.js b/source/js/main.js index 2903163..d036dca 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -7,9 +7,11 @@ $(this).after('' + this.alt + ''); } - $(this).wrap(''); + // 对于已经包含在链接内的图片不适用lightGallery + if ($(this).parent().prop("tagName") !== 'A') { + $(this).wrap(''); + } }); - }); if (lightGallery) { var options = {