使用swiper制作轮播图

用cmd命令行窗口通过node 安装 express swiper:
express-art-template art-template jquery
建这几个盒子
<div clas="swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">slider1</div>
<div class="swiper-slide">slider2</div>
<div class="swiper-slide">slider3</div>
</div>
</div>
在js中写入
var mySwiper = new Swiper('.swiper', {
autoplay: true,//可选选项,自动滑动
})
最后链入连接
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.1/css/swiper.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.1/js/swiper.min.js"></script>
插入图片,用css调整盒子即可
上一篇:CS144lab笔记


下一篇:轮播图swiper基本属性