我正在使用一个名为Filterizr的响应式图库网格,我对哪些选项放在哪里感到困惑。
我有这个:
$(function() {
//Initialize filterizr with default options
$('.filtr-container').filterizr(
options = {
animationDuration: 0.5,
callbacks: {
onFilteringStart: function() { },
onFilteringEnd: function() { },
onShufflingStart: function() { },
onShufflingEnd: function() { },
onSortingStart: function() { },
onSortingEnd: function() { }
},
delay: 0,
delayMode: 'progressive',
easing: 'ease-out',
filter: 'all',
filterOutCss: {
opacity: 0.5,
transform: 'scale(0.5)'
},
filterInCss: {
opacity: 0.5,
transform: 'scale(1)'
},
layout: 'sameSize',
selector: '.filtr-container',
setupControls: true
}
);
});
但是网站上列出了一个shuffle方法,我不知道里面的选项放在哪里:
.filterizr('shuffle')
任何提示?非常感谢。
答案 0 :(得分:0)
我认为filterizr未初始化,因为选项传递错误。你应该做的
$(function() {
//Initialize filterizr with default options
$('.filtr-container').filterizr({
animationDuration: 0.5,
callbacks: {
onFilteringStart: function() { },
onFilteringEnd: function() { },
onShufflingStart: function() { },
onShufflingEnd: function() { },
onSortingStart: function() { },
onSortingEnd: function() { }
},
delay: 0,
delayMode: 'progressive',
easing: 'ease-out',
filter: 'all',
filterOutCss: {
opacity: 0.5,
transform: 'scale(0.5)'
},
filterInCss: {
opacity: 0.5,
transform: 'scale(1)'
},
layout: 'sameSize',
selector: '.filtr-container',
setupControls: true
}
);
});
或者您应该使用setOptions方法
var options = {your options object to override default options};
filterizd.filterizr('setOptions', options)