首页 > 其他 > 详细

swiper使用-点击跳转指定页

时间:2020-08-21 15:10:49      阅读:624      评论:0      收藏:0      [点我收藏+]

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{
   //否则不轮播
}

  

swiper使用-点击跳转指定页

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!