swiperjs不滑过iframe
我已经在nuxtjs中实现了swiper。我必须在幻灯片中以iframe的形式嵌入广告。但是我的刀刀抓住了iframe。它没有在iframe上滑动。 我尝试在iframe中添加滚动='no',但这无效。 的事件
我也想达到iframe我的代码
new Swiper(this.$refs.swiper, {
slidesPerView: 'auto',
spaceBetween: 20,
centeredSlidesBounds: true,
centerInsufficientSlides: true,
watchSlidesProgress: true,
watchSlidesVisibility: true,
direction: 'horizontal',
mousewheel: true,
observer: true,
observeParents: true,
freeMode: true,
parallax: true,
initialSlide: slideNumber,
keyboard: {
enabled: true
},
scrollbar: {
el: '.swiper-scrollbar',
draggable: true
},
loopFillGroupWithBlank: false,
pagination: {
clickable: true
},
autoHeight: true,
modules: 'modules',
on: {
activeIndexChange: function (swiper) {
vm.listenAds()
setTimeout(() => {
swiper.params.centeredSlides = true
swiper.update()
}, 100)
},
afterInit: function (swiper) {
setInterval(() => {
swiper.update()
}, 100)
}
}
})
}```
I have implemented Swiper in NuxtJs. I have to embed ads in the form of iFrame in slides. But my swiper stuck at iFrame. It is not sliding over the iframe.
I have tried adding scrolling='no' to the iframe, but it didn't work.
Also I want to hit the events of the iframe
My Code
new Swiper(this.$refs.swiper, {
slidesPerView: 'auto',
spaceBetween: 20,
centeredSlidesBounds: true,
centerInsufficientSlides: true,
watchSlidesProgress: true,
watchSlidesVisibility: true,
direction: 'horizontal',
mousewheel: true,
observer: true,
observeParents: true,
freeMode: true,
parallax: true,
initialSlide: slideNumber,
keyboard: {
enabled: true
},
scrollbar: {
el: '.swiper-scrollbar',
draggable: true
},
loopFillGroupWithBlank: false,
pagination: {
clickable: true
},
autoHeight: true,
modules: 'modules',
on: {
activeIndexChange: function (swiper) {
vm.listenAds()
setTimeout(() => {
swiper.params.centeredSlides = true
swiper.update()
}, 100)
},
afterInit: function (swiper) {
setInterval(() => {
swiper.update()
}, 100)
}
}
})
}```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论