swiper使用-点击跳转指定页

时间:2020-08-21 15:10:49   收藏:0   阅读:626

1、点击swiper以外元素跳转至指定页

var index = $(this).index() // var index = 1
1、$(".swiper-pagination span").eq(index).trigger(‘click‘);
2、swiper.slideTo(index, 10, false);

2、某种条件下触发swipe滚动事件

if (index=="2") { //节假日、生日并存
  var swiper = new Swiper(‘.swiper-container2‘, {
	loop: true,
	autoplay: 1500,
  });
}else{
   //否则不轮播
}

  

原文:https://www.cnblogs.com/cdj61/p/13540462.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!