<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="dist/css/swiper.css"> <script src="dist/js/swiper.js"> </script> <style> html, body { position: relative; height: 100%; } body { background: #eee; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #000; margin: 0; padding: 0; } .swiper-container { width: 100%; height: 100%; } .swiper-slide { text-align: center; font-size: 18px; background: #fff; /* Center slide text vertically */ display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; } </style> </head><body> <!-- Swiper --> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide">Slide 1</div> <div class="swiper-slide">Slide 2</div> <div class="swiper-slide">Slide 3</div> <div class="swiper-slide">Slide 4</div> </div> <!-- Add Pagination --> <div class="swiper-pagination"></div> </div> <!-- Initialize Swiper --> <script> var swiper = new Swiper('.swiper-container', { direction: 'vertical', pagination: { el: '.swiper-pagination', clickable: true, }, }); swiper.on('slideChangeTransitionStart', function () { let previousIndex = swiper.previousIndex; let swiperIndex = swiper.activeIndex; console.log(previousIndex) if(swiperIndex == 1){ swiper.slideTo(previousIndex) } }); </script></body></html>现在的效果是,点击第二个小圆点是无效的

注意:swiper4以上有效
原文转载:http://www.shaoqun.com/a/489652.html
photobucket:https://www.ikjzd.com/w/132
淘粉吧怎么返利:https://www.ikjzd.com/w/1725
贸发局:https://www.ikjzd.com/w/1621
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Document</title><linkrel="stylesheet"href="dist/css/swiper.css&
赛兔:https://www.ikjzd.com/w/2375
1号店网:https://www.ikjzd.com/w/2263
报了一个西冲两日游的旅游团需要准备什么?:http://tour.shaoqun.com/a/1142.html
惠州到越美冰雪大世界开车怎么走?越美冰雪大世界自驾车路线?:http://tour.shaoqun.com/a/30608.html
欧洲VAT你所关心的问题都在这里:https://www.ikjzd.com/home/2910
没有评论:
发表评论