素材牛VIP会员
关于swiper 轮播图,手势滑动以后不能继续轮播的问题;?
 何***孽  分类:JavaScript  人气:1039  回帖:1  发布于6年前 收藏

swiper 轮播图,手势滑动以后不能继续轮播的问题;
去了解了一下, 发现有个属性: autoplayDisableOnInteraction: false 是用来控制 手势滑动过以后,依然能够重启轮播的属性,但是我加上去以后并不管用。
我用的是swiper4.0.5 感觉应该是版本的问题 ,我试了其他版本,发现是能够起作用的。
但是因为各种原因,没办法改变版本, 求教,4X版本是有问题吗? 为什么不支持这个属性

mySwiper4 = new Swiper('.slotMachinesinfo .swiper-container', {
      direction: 'vertical',
      loop: true,
      autoplay: true,
      speed: 800,
      autoplayDisableOnInteraction: false
    });

而且更过分的是 autoplay 后面不能写毫秒数,必须为true;否则就不轮播

 标签:swiperjavascript

讨论这个帖子(1)垃圾回帖将一律封号处理……

Lv2 入门
一***句 职业无 6年前#1

swiper4做了组件化的深化,可能是把autoplayDisableOnInteraction放到了autoplay里面了,你可以试试:

mySwiper4 = new Swiper('.slotMachinesinfo .swiper-container', {
    direction: 'vertical',
    loop: true,
    autoplay: true,
    speed: 800,
    autoplay: {
        disableOnInteraction: false
    }
});

 文明上网,理性发言!   😉 阿里云幸运券,戳我领取