时间:2021-07-01 10:21:17 帮助过:21人阅读
<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> <div class="swiper-pagination"></div> <div class="swiper-button-next"></div> <div class="swiper-button-prev"></div> </div>
然后到js当中进行页面的初始化,再加上我们的循环属性(loop:true).
var swiper = new Swiper('.swiper-container',{ pagination:'.swiper-pagination', paginationClickable:true, nextButton:'.swiper-button-next', prevButton:'.swiper-button-prev', slidesPerView:1, spaceBetween:30, loop:true //开启循环属性 });
完成之后我们就可以一直进行翻页了,能玩三天三夜,还不会累!
以上就是swiper的基础使用(十四)的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!