var mySwiper = new Swiper('.swiper-container)

1.锁定

mySwiper.lockSwipes();

2.解锁

mySwiper.unlockSwipes();

3.切换到第一个slide,速度为1秒

mySwiper.slideTo(0, 1000, false);

4.设定初始化时slide的索引

initialSlide :2

5.嵌套滑动

nested
用于嵌套相同方向的swiper时,当切换到子swiper时停止父swiper的切换。
请将子swiper的nested设置为true。
由于需要在slideChangeEnd时判断作用块,因此快速滑动时这个选项无效。
 
6.centeredSlides
设定为true时,活动块会居中,而不是默认状态下的居左。

相关文章:

  • 2021-12-09
  • 2021-04-28
  • 2021-08-12
  • 2022-01-19
  • 2021-09-08
  • 2022-02-02
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2021-07-08
  • 2021-12-03
  • 2022-02-21
  • 2022-12-23
相关资源
相似解决方案