Swiper輪播手動后不動


最近項目首頁輪播圖用了Swiper輪播,今天突然發現輪播圖動畫初始正常但是手動換過之后就不動了,解決方法有兩種,具體根據采用的情況為准:

1、autoplayDisableOnInteraction:false,

var mySwiper = new Swiper(".swiper-container", {
    autoplay: 3000, //可選選項,自動滑動
    autoplayDisableOnInteraction:false,
    observer: true,
    observeParents: true,
    paginationClickable: true,
    watchSlidesProgress: true,
    watchSlidesVisibility: true
});
                    
                        

當autoplayDisableOnInteraction:false的時候,手動滑動自動滑動不會失效

 

2、網上最多的:disableOnInteraction:false,

var mySwiper = new Swiper(".swiper-container", {
    autoplay: {
      delay: 2500,
      disableOnInteraction: false,
    },
    observer: true,
    observeParents: true,
    paginationClickable: true,
    watchSlidesProgress: true,
    watchSlidesVisibility: true
});

話不多說,其實只是寫法不用,屬性作用一樣。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM