1.需要引用tools.js文件 style.css文件(css文件可以根据个人需要更改)
2.文档结构
大图div
<div class="swiper-content"></div>
小图div
<div class="mobile-content"></div>
3.调用方法,传图
window.onload = function(){ tools.swiperbanner('.swiper-content','.mobile-content',{ bannerpic:["img/banner-01.png","img/banner-02.png","img/banner-03.png"], mobilepic:["img/banner-m01.png","img/banner-m02.png","img/banner-m03.png"] }) }