使用 Swiper 時, Mobile 版不能設定 slidesPerGroup, 否則會看到最後一組商品.
有點怪的 bug, mobile 版的 slidesPerGroup 只能設為 1
var slidesPerGroup = 5;
if (S3JS.isMobile()) {
slidesPerGroup = 1; // 很奇怪, Mobile 版時, 若是設定 slidesPerGroup = 5 時, 剛進入時會看到最後一組商品.
}
//beauty-coin-exchange-loading
var swiperPreview = new Swiper('.beauty-coin-exchange-swiper', {
slidesPerView: 5,
slidesPerColumn: 1,
slidesPerGroup: slidesPerGroup,
spaceBetween: 0,
loop: true,
breakpoints: {
768: {
slidesPerView: 4.3,
spaceBetween: 10,
}
},
nextButton: '.beauty-coin-next',
prevButton: '.beauty-coin-prev',
});