在swiper.js中有一個(gè)autoplayDisableOnInteraction參數(shù)属划,設(shè)置為false恬叹,就可以了。
用戶操作swiper之后同眯,是否禁止autoplay绽昼。默認(rèn)為true:停止。
如果設(shè)置為false须蜗,用戶操作swiper之后自動(dòng)切換不會(huì)停止硅确,每次都會(huì)重新啟動(dòng)autoplay。
操作包括觸碰明肮,拖動(dòng)菱农,點(diǎn)擊pagination等
swiperOption: {pagination: '.swiper-pagination', loop: true, autoplay : 2000, autoplayDisableOnInteraction: false, },