|
我是用的网格布局,请问如何get到slidesPerView? 已经设置好了,如何拿到这个值
console.log(this.realIndex); 就像拿realindex 一样
new Swiper('.swiper-',{
watchOverflow: true,
slidesPerView: 4,
spaceBetween: 24,
slidesPerGroup: 4,
loop: true,
loopFillGroupWithBlank: true,
keyboard : true,
noSwiping: true,
noSwipingSelector: 'input, select, button',
navigation: {
nextEl: '.swiper-' + category_item.category_id + '-next',
prevEl: '.swiper-' + category_item.category_id + '-prev',
},
on: {
slideChangeTransitionEnd: function () {
console.log(this.realIndex);
},
resize: function(){
//窗口变化了
},
},
breakpoints: {
320: {
slidesPerView: 1,
slidesPerGroup: 1
},
640: {
slidesPerView: 2,
slidesPerGroup: 2
},
900: {
slidesPerView: 3,
slidesPerGroup: 3
},
1200: {
slidesPerView: 4,
slidesPerGroup: 4
}
}
});
|
|