From ef879b9bfb65e1cb0bd3a29cc4c4ed6f8544ba63 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Fri, 6 Dec 2019 12:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=AE=98=E7=BD=91=E8=BD=AE?= =?UTF-8?q?=E6=92=AD=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/Mobile/js/home.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/Public/Mobile/js/home.js b/Public/Mobile/js/home.js index 9c8a6ef15..a131a6b20 100644 --- a/Public/Mobile/js/home.js +++ b/Public/Mobile/js/home.js @@ -1,17 +1,27 @@ $(function(){ var img = $(".swiper-container .swiper-slide").length; - var swiper = new Swiper('.swiper-container', { - loop: true, - pagination: { - el: '.swiper-pagination', - clickable: true, - }, - /*autoplay: { - delay: 3000, - stopOnLastSlide: false, - disableOnInteraction: false, - },*/ - autoplay: img > 1, - }); + + if(img<=1){ + var swiper = new Swiper('.swiper-container', { + loop: true, + autoplay: img > 1, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); + }else{ + var swiper = new Swiper('.swiper-container', { + loop: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + autoplay: { + stopOnLastSlide: false, + disableOnInteraction: false, + }, + }); + } }); \ No newline at end of file