Swiper中文论坛
标题:
请问如何 get 到 slidesPerView 的al?
[打印本页]
作者:
foolain
时间:
2020-5-21 10:51
标题:
请问如何 get 到 slidesPerView 的al?
我是用的网格布局,请问如何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
}
}
});
作者:
foolain
时间:
2020-5-21 10:55
或者说如何获取当前View显示多少个 item ? 因为我做了循环,有留白
作者:
foolain
时间:
2020-5-21 13:05
已经通过 this.params.slidesPerView 拿到了
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2