Swiper中文论坛

标题: 多个相同特效,无法暂停自动播放和启动 [打印本页]

作者: 墨染锦年    时间: 2019-11-8 21:53
标题: 多个相同特效,无法暂停自动播放和启动
  1. var picxun = new Swiper('.in_pic .swiper-container', {
  2.             loop: true,
  3.             simulateTouch: false,
  4.             slidesPerView: 2,
  5.             spaceBetween: 10,
  6.             autoplay: {
  7.                 delay: 4000,
  8.                 disableOnInteraction: false,
  9.             },
  10.             navigation: {
  11.                 nextEl: '.pic-but .next',
  12.                 prevEl: '.pic-but .prev',
  13.             }
  14.         });
  15. //js2
  16.         $(".in_pic").mouseenter(function() {
  17.             picxun.autoplay.stop();
  18.         }).mouseleave(function() {
  19.             picxun.autoplay.start();
  20.         });
复制代码
页面中有两个.in_pic .swiper-container。。如果不使用JS2的效果,正常。。。






欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/) Powered by Discuz! X3.2