; (function() { var initViewCount = isMobile() ? 2.3 : 7; var perGroup = isMobile() ? 1 : 7; new Swiper('.related-goods-swiper', { slidesPerView: initViewCount, spaceBetween: 7, slidesPerGroup: perGroup, loopFillGroupWithBlank: true, direction: 'horizontal', loop: true, // 如果需要前进后退按钮 navigation: { nextEl: '.swiper-button-next2', prevEl: '.swiper-button-prev2', lockClass: 'lock-class' } }); })();