场景:loop为true, 通过Dom 给img 手动绑定点击事件跳转url( img上面绑定data-url='www.****.com' );
自动滚动一圈时, 点击事件失效;
原因看文档,loop为true时,他们的操作。
解决方案:
在new Swiper({
onClick:function(swiper,event) {
console(event.target.dataset.url)
}
})
场景:loop为true, 通过Dom 给img 手动绑定点击事件跳转url( img上面绑定data-url='www.****.com' );
自动滚动一圈时, 点击事件失效;
原因看文档,loop为true时,他们的操作。
解决方案:
在new Swiper({
onClick:function(swiper,event) {
console(event.target.dataset.url)
}
})