Added support for lazyloading of images (#266)
This commit is contained in:
parent
968a31ed90
commit
9ed876f49e
|
@ -9,13 +9,13 @@
|
|||
|
||||
// 对于已经包含在链接内的图片不适用lightGallery
|
||||
if ($(this).parent().prop("tagName") !== 'A') {
|
||||
$(this).wrap('<a href="' + this.src + '" title="' + this.alt + '" class="gallery-item"></a>');
|
||||
$(this).wrap('<a href="' + ($(this).attr("data-imgbig") ? $(this).attr("data-imgbig") : this.src) + '" title="' + this.alt + '" class="gallery-item"></a>');
|
||||
}
|
||||
});
|
||||
});
|
||||
if (typeof lightGallery != 'undefined') {
|
||||
var options = {
|
||||
selector: '.gallery-item',
|
||||
selector: '.gallery-item'
|
||||
};
|
||||
$('.article-entry').each(function(i, entry) {
|
||||
lightGallery(entry, options);
|
||||
|
|
Loading…
Reference in New Issue