[英]lightgallery UPDATE INDEX
With the filter option (uikit), we can put img mosaic in display:none
, but how can we update
the lightbox index
from lightgallery.js
plugin please? 使用滤镜选项(uikit),我们可以将img马赛克放置在display:none
,但是如何从lightgallery.js
插件中update
灯箱index
呢?
JS : JS:
var $lg = $('.js-filter');
$lg.lightGallery({thumbnail: false});
// $lg.data('lightGallery').destroy(true); ???
Thank you! 谢谢!
I think you could hook to the uikit filter event, to destoy and trigger a new gallery: 我认为您可以挂接到uikit筛选器事件,以进行存储并触发新的画廊:
// Gallery container
var $lg = $('.js-filter');
// Initialize the gallery for all the elements
$lg.lightGallery({
selector: 'li',
thumbnail: false
});
// After uikit filter is applied
$('[uk-filter]').on('afterFilter', function() {
// Destoy the previously created gallery
$lg.data('lightGallery').destroy(true);
// Initialize new gallery with just the visible items
$lg.lightGallery({
selector: 'li:visible',
thumbnail: false
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.