本文介绍了无法在被动事件侦听器中阻止默认 - Swipebox Mobie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 Swipebox:http://brutaldesign.github.io/swipebox/我知道我可以用这样的 swipebox 幻灯片打开内容
I'm using Swipebox : http://brutaldesign.github.io/swipebox/I know that I can open a content with swipebox slide like that
// Link to click
<a href="#mydiv" class="my-swipebox">Click to show</a>
// And the div in html
<div id="#mydiv">Click <a href="http://example.com">Here</div>
问题是当它在 mobie 上通过 swipebox 打开时我无法点击这个 div 中的链接(在桌面上它工作得很好)
The problem is I can't click the link inside this div when it opened by swipebox on mobie (on desktop it working very fine)
chrome 浏览器显示此日志:
The chrome browser show this log :
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
preventDefault @ js_3q9o_g1v9VMwOb38KwiIL35eXGTsWaJ31hpdemJVNbY.js:5
dispatch @ js_3q9o_g1v9VMwOb38KwiIL35eXGTsWaJ31hpdemJVNbY.js:5
v.handle @ js_3q9o_g1v9VMwOb38KwiIL35eXGTsWaJ31hpdemJVNbY.js:5
我该如何解决这个问题,非常感谢
How can I fix this problem, thank you so much
推荐答案
我在 .js 中添加了 loop: true
为了这 :$('.owl-carousel').owlCarousel({
它的工作
I added loop: true
in .jsfor this :$('.owl-carousel').owlCarousel({
and it's work
这篇关于无法在被动事件侦听器中阻止默认 - Swipebox Mobie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!