更新时间:2020-02-04 00:23:47
使用这个插件的时候,先引入jq
$('.demo').slider({
imgList: [
{
img: './img/p1.jpg',
a: '跳转url地址',
},
{
img: './img/p2.jpg',
a: '跳转url地址',
},
{
img: './img/p3.jpg',
a: '跳转url地址',
}
], //图片的列表,a属性里面存放的是网络地址,img存放的是图片地址
width: 500, //图片的宽
height: 300, //图片的高
isAuto: true, //是否自动轮播
moveTime: 3000, //运动时间
direction: 'right', //轮播的方向
btnWidth: 30, //按钮的宽
btnHeight: 30, //按钮的高
spanWidth: 10, //span按钮的宽
spanHeight: 10, //span按钮的高
spanColor: '#fff', //span按钮的颜色
activeSpanColor: 'red', //选中的span颜色
btnBackgroundColor: 'rgba(0, 0, 0, 0.3)', //两侧按钮的颜色
spanRadius: '50%', //span按钮的圆角程度
spanMargin: 3, //span之间的距离
})