有时候使用swiper并不想让它滑动,怎么设置呢?
1.noSwiping设为true
2.在slide上(或其他元素)增加类名'swiper-no-swiping',使该slide无法拖动。
案例:
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide swiper-no-swiping">
slider1</div>
<div class="swiper-slide swiper-no-swiping">
slider2</div>
<div class="swiper-slide swiper-no-swiping">
slider3</div>
</div>
</div>
<script language="javascript">
var mySwiper = new Swiper('.swiper-container',{
noSwiping : true,
})
</script>