HTML结构
Slide 1Slide 2Slide 3Slide 4
Swiper.js设置
var banner = new Swiper('.swiper-banner', {
//分页,多个分页可以使用不同的class名
pagination: '.swiper-pagination-banner',
//点击切换
paginationClickable: true,
//自动播放时间
autoplay:5000,
//切换速度,即slider自动滑动开始到结束的时间(单位ms),也是触摸滑动时释放至贴合的时间。
speed:2000,
//复制slide,看起来是循环的
loop:true,
//用户操作swiper之后,是否禁止autoplay.默认为true:停止。
autoplayDisableOnInteraction:false,
//拖动释放时不会输出信息,阻止click冒泡。拖动Swiper时阻止click事件。
preventlinksPropagation:true
});
4.0以上 Swiper.js设置
var swiper = new Swiper('.swiper-container1', {
// slidesPerView: 3,
// slidesPerColumn: 2,
spaceBetween: 10,
loop: true,
autoplay: true,
autoplayDisableOnInteraction: false,//这个加了没啥用
on: {
slideChangeTransitionEnd: function() {
this.autoplay.start();//就加这个玩意儿
},
}
});
























18605917465
客服QQ