使用步骤
1.引用js
<script src="swiper/swiper.min.js" type="text/javascript" charset="utf-8"></script>
2.html部分
<div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide"><img src="img/lb_01.jpg" /></div> <div class="swiper-slide"><img src="img/lb_02.jpg" /></div> <div class="swiper-slide"><img src="img/lb_03.jpg" /></div> <div class="swiper-slide"><img src="img/lb_04.jpg" /></div> </div> <!-- Add Arrows --> <div class="swiper-button-next"></div> <div class="swiper-button-prev"></div> </div>
tip:修改箭头样式
<!--需在引用的js后修改--> <style type="text/css"> .swiper-button-prev{background: url("img/lb_prev.png") no-repeat center center;} .swiper-button-next{background: url("img/lb_next.png") no-repeat center center;} </style>