fix: do not wrap img that already included in a link
This commit is contained in:
parent
c67932d390
commit
0019afad22
|
@ -7,9 +7,11 @@
|
||||||
$(this).after('<span class="caption">' + this.alt + '</span>');
|
$(this).after('<span class="caption">' + this.alt + '</span>');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).wrap('<a href="' + this.src + '" title="' + this.alt + '" class="gallery-item"></a>');
|
// 对于已经包含在链接内的图片不适用lightGallery
|
||||||
|
if ($(this).parent().prop("tagName") !== 'A') {
|
||||||
|
$(this).wrap('<a href="' + this.src + '" title="' + this.alt + '" class="gallery-item"></a>');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
if (lightGallery) {
|
if (lightGallery) {
|
||||||
var options = {
|
var options = {
|
||||||
|
|
Loading…
Reference in New Issue