gpt4 book ai didi

javascript - 在 Firefox 4 for Android 中禁用文档上的触摸事件

转载 作者:行者123 更新时间:2023-11-30 04:42:22 24 4
gpt4 key购买 nike

我可以通过下面的代码在 android 的 webkit 浏览器上禁用触摸事件。

$(document).bind('touchmove', function(e){epreventDefault();}); 

但它似乎不适用于新的 Firefox 4 for Android。知道怎么做吗?

最佳答案

$(document).bind('MozTouchMove', function(e){e.preventDefault();});   

我认为这应该有效。不同之处在于 Mozilla 将它们的触摸事件命名为不同的名称:

MozTouchDown: "Sent when the user begins a screen touch action."
MozTouchMove: "Sent when the user moves his finger on the touch screen."
MozTouchUp: "Sent when the user lifts his finger off the screen."

附言它是“e.preventDefault();” ...你忘了“。”在您的代码中。

关于javascript - 在 Firefox 4 for Android 中禁用文档上的触摸事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5739149/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com