|
可以实现的
var slidesPerGroup = function(){
if($(this).outerWidth(true) > 1200 || $(this).outerWidth(true) > 992)
return 4;
else if($(this).outerWidth(true) > 768)
return 3;
else if($(this).outerWidth(true) < 768)
return 2;
};
var swiper = new Swiper('.page-carousel .swiper-container', {
autoplay: 2500,
autoplayDisableOnInteraction: false,
calculateHeight : true,
loop:true,
slidesPerView : slidesPerGroup(),
slidesPerGroup : slidesPerGroup(),
resizeReInit : true,
onFirstInit : function(swiper){
swiper.params.slidesPerView = swiper.params.slidesPerGroup = slidesPerGroup();
},
onInit : function(swiper){
swiper.params.slidesPerView = swiper.params.slidesPerGroup = slidesPerGroup();
},
}); |
|