我想在jqPhotoSwipe
之后销毁uikit filter
(https://github.com/ergec/jQuery-for-PhotoSwipe)画廊,以便更新index
。
这是destroy
的方法:http://photoswipe.com/documentation/api.html
但是我没有设法...
JS :
$(document).ready(function() {
var mosaic = $('.js-filter li');
mosaic.jqPhotoSwipe({
forceSingleGallery: true
});
});
$('[uk-filter]').on('afterFilter', function() {
// destroy PhotoSwipe here and build another one
});
感谢您的帮助!
答案 0 :(得分:0)
我的解决方案:
$(document).ready(function() {
var pswp = function() {
var mosaic = $('.js-filter li');
mosaic.jqPhotoSwipe({
forceSingleGallery: true,
});
};
pswp();
$('[uk-filter]').on('afterFilter', function() {
pswp = null;
var mosaic = $('.js-filter li:visible');
mosaic.jqPhotoSwipe({
forceSingleGallery: true,
});
});
});