zoukankan      html  css  js  c++  java
  • 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
    });

    话不多说,其实只是写法不用,属性作用一样。

  • 相关阅读:
    JVM内存问题分析
    CAS
    普通内部类,匿名内部类和静态内部类
    文章简介
    conda更换下载源
    MySQL常见约束
    MySQL常见的数据类型
    DDL(数据定义语言)
    DML语言(数据操纵语言)
    进阶9:联合查询
  • 原文地址:https://www.cnblogs.com/wy120/p/11856737.html
Copyright © 2011-2022 走看看