Authored by 张孝茹

店铺轮播

@@ -50,15 +50,17 @@ if ($('.shop-swiper')) { @@ -50,15 +50,17 @@ if ($('.shop-swiper')) {
50 let num = $('.shop-swiper').length; 50 let num = $('.shop-swiper').length;
51 51
52 for (let i = 1; i <= num; i++) { 52 for (let i = 1; i <= num; i++) {
53 - new Swiper2('.shop-swiper-' + i, {  
54 - lazyLoading: true,  
55 - lazyLoadingInPrevNext: true,  
56 - loop: true,  
57 - autoplay: 3000,  
58 - slideElement: 'li',  
59 - paginationClickable: true,  
60 - pagination: $(this).closest('.shop-swiper-' + i).find('.pagination-inner').get(0)  
61 - }); 53 + if ($('.shop-swiper-' + i).find('.swiper-slide').length > 1) {
  54 + new Swiper2('.shop-swiper-' + i, {
  55 + lazyLoading: true,
  56 + lazyLoadingInPrevNext: true,
  57 + loop: true,
  58 + autoplay: 3000,
  59 + slideElement: 'li',
  60 + paginationClickable: true,
  61 + pagination: $(this).closest('.shop-swiper-' + i).find('.pagination-inner').get(0)
  62 + });
  63 + }
62 } 64 }
63 } 65 }
64 66