Files
ClassContent/历届学生/逯帅帅/项目开发/上课项目/swiper/需求分析
2024-09-27 02:06:13 +08:00

28 lines
852 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

【完成】1:initialSlide 默认展示第几张图
2:direction 设置滚动方向:vertical 垂直 ,horizontal 水平
【完成】3:speed 设置轮播滚动时候的速度
【完成】4:grabCursor : true 设置鼠标形状为手
【完成】5:slideChange 监听轮播图滚动到第几张了
var mySwiper = new Swiper('.swiper-container', {
on: {
slideChange: function () {
console.log(this.activeIndex);
},
},
};
var mySwiper = new Swiper('.swiper-container');
mySwiper.on('slideChange', function () {
});
6:loop 是否可以循环滚动 true 可以, false 不可以
【完成】7:autoplay 是否自动播放
【完成】8:time 每隔几秒播放一次
【完成】9:slideTo 方法,控制轮播图切换到对应的下标
mySwiper.slideTo(0, 1000, false);//切换到第一个slide,速度为1秒