swiper点击出现空白的解决办法
程序员文章站
2024-02-21 17:18:22
...
swiper点击出现空白的解决办法
<div class="swiper-container2 ">
<div class="swiper-wrapper">
<div class="swiper-slide swiper-slide-active">全部</div>
<div class="swiper-slide">电商类</div>
<div class="swiper-slide">金融类</div>
<div class="swiper-slide">医疗类</div>
<div class="swiper-slide">地产类</div>
<div class="swiper-slide">Slide 6</div>
<div class="swiper-slide">Slide 7</div>
<div class="swiper-slide">Slide 8</div>
<div class="swiper-slide">Slide 9</div>
<div class="swiper-slide">Slide 10</div>
</div>
</div>
var mySwiper2 = new Swiper('.swiper-container2', {
slidesPerView: 5,
spaceBetween: 30,
centeredSlides: true,
loop: true,
on: {
click: function() {
console.log(this.clickedIndex)
mySwiper2.slideTo(this.clickedIndex);
mySwiper2.slideToLoop(this.realIndex);//解决swiper空白
mySwiper6.slideTo(this.clickedIndex);
mySwiper6.slideToLoop(this.realIndex);
},
touchMove: function() {
mySwiper2.lockSwipes(); //禁止滑动
},
},
});
推荐阅读
-
swiper点击出现空白的解决办法
-
Destoon旺旺无法正常显示,点击提示“会员名不存在”的解决办法_php实例
-
SQL Server 2008安装过程中出现1608错误的解决办法
-
详解IOS点击空白处隐藏键盘的几种方法介绍
-
Discuz升级提示static/image/postbg/3.jpg下载出现问题的解决办法_PHP教程
-
Destoon旺旺无法正常显示,点击提示“会员名不存在”的解决办法
-
在IOS系统上滚动条滚动到指定的位置出现空白页面的解决方案
-
Android点击EditText文本框之外任何地方隐藏键盘的解决办法
-
PHP Date()出现错误的具体解决办法
-
iOS实现手指点击出现波纹的效果