遍历实例化swiper
var list = $('.p04-s2 li');
list.each(function (index) {
new Swiper ($(this).find('.swiper-container'), {
spaceBetween: 10,
slidesPerView : 3,
watchOverflow: true,
centeredSlides : true,
loop: true,
breakpoints: {
1500: {
slidesPerView: 2
},
1200: {
slidesPerView: 1
}
},
pagination: {
el: $(this).find('.swiper-pagination'),
clickable :true
},
navigation: {
prevEl: $(this).find('.prev-btn'),
nextEl: $(this).find('.next-btn'),
}
});
});
如果是tab下遍历swiper