Showing
1 changed file
with
7 additions
and
0 deletions
1 | let $ = require('yoho-jquery'); | 1 | let $ = require('yoho-jquery'); |
2 | let Swiper = require('yoho-swiper'); | 2 | let Swiper = require('yoho-swiper'); |
3 | let mySwiper; | 3 | let mySwiper; |
4 | +let $swiperSlide = $('.swiper-wrapper .swiper-slide'); | ||
5 | +let $chanBtn = $('.qrcode-wrap .chan'); | ||
4 | 6 | ||
5 | mySwiper = new Swiper('.swiper-container', { | 7 | mySwiper = new Swiper('.swiper-container', { |
6 | onSlideChangeStart: function(swiper) { | 8 | onSlideChangeStart: function(swiper) { |
7 | $('.pagec').html(swiper.snapIndex + 1); | 9 | $('.pagec').html(swiper.snapIndex + 1); |
8 | } | 10 | } |
9 | }); | 11 | }); |
12 | + | ||
13 | +if ($swiperSlide.length <= 1) { | ||
14 | + $chanBtn.hide(); | ||
15 | +} | ||
16 | + | ||
10 | $('.prev').click(function() { | 17 | $('.prev').click(function() { |
11 | mySwiper.slidePrev(); | 18 | mySwiper.slidePrev(); |
12 | }); | 19 | }); |
-
Please register or login to post a comment