swiper去除滑动设置

有时候使用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>
posted @ 2016-03-26 10:26  TBHacker  阅读(10748)  评论(2编辑  收藏  举报