加上这个observer:true, observeParents:true也不可以
var newSwiper = new Swiper ('.swiper-second', {
direction: 'horizontal', // 垂直切换选项
loop: true, // 循环模式选项
pagination: {
el: '#swiper-two', // 如果需要分页器
clickable :true,
},
observer:true, //修改swiper自己或子元素时,自动初始化swiper
observeParents:true, //修改swiper的父元素时,自动初始化swiper
autoplay: {
delay: 1000, //时间 毫秒
disableOnInteraction: true //用户操作之后是否停止自动轮播默认true
}
})
var nextSwiper = new Swiper ('.swiper-third', {
direction: 'horizontal', // 垂直切换选项
loop: true, // 循环模式选项
pagination: {
el: '#swiper-three', // 如果需要分页器
clickable :true
},
observer:true, //修改swiper自己或子元素时,自动初始化swiper
observeParents:true, //修改swiper的父元素时,自动初始化swiper
autoplay: {
delay: 1000, //时间 毫秒
disableOnInteraction: true //用户操作之后是否停止自动轮播默认true
}
})
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
亲~把这个注释掉就可以了哦 disableOnInteraction: true 。默认是true也不可以哦~必须注释掉才可以哦~看到答案的话回句话啊:)