版本爲1.3html
當使用了 swiper 後:api
var mySwiper = new Swiper('.banner .swiper-container', { autoplay: 3000, loop: true, pagination: '.swiper-pagination', autoplayDisableOnInteraction : false })
解決辦法便是設置這個參數: autoplayDisableOnInteraction
官網給出的參數介紹:
用戶操做 swiper 以後,是否禁止 autoplay 。默認爲 true:中止。
若是設置爲 false,用戶操做 swiper 以後自動切換不會中止,每次都會從新啓動 autoplay。
操做包括 觸碰,拖動,點擊 pagination 等。