时间:2021-07-01 10:21:17 帮助过:25人阅读
<div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide">H5EDU 1<img src="logo.png"></div> <div class="swiper-slide">H5EDU 2<img src="logo.png"></div> <div class="swiper-slide">H5EDU 3<img src="logo.png"></div> <div class="swiper-slide">H5EDU 4<img src="logo.png"></div> <div class="swiper-slide">H5EDU 5<img src="logo.png"></div> <div class="swiper-slide">H5EDU 6<img src="logo.png"></div> <div class="swiper-slide">H5EDU 7<img src="logo.png"></div> <div class="swiper-slide">H5EDU 8<img src="logo.png"></div> <div class="swiper-slide">H5EDU 9<img src="logo.png"></div> <div class="swiper-slide">H5EDU 10<img src="logo.png"></div> </div> <div class="swiper-pagination"></div> </div>
然后就要在初始化当中添加我们的free模式的属性了
<script> var swiper = new Swiper('.swiper-container',{ pagination:'.swiper-pagination', paginationClickable:true, slidesPerView:3, spaceBetween:30, freeMode:true //free模式开启 }); </script>
实现之后我们来观看效果,free模式就是可以将翻页位置在任意位置停止。不再限制在页面当中
以上就是swiper基础使用(八)的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!