在Android 4的Firefox 4文档中禁用触摸事件
问题描述:
我可以通过下面的代码禁用Android的webkit浏览器上的触摸事件。在Android 4的Firefox 4文档中禁用触摸事件
$(document).bind('touchmove', function(e){epreventDefault();});
但它似乎不适用于Android的新的Firefox 4。任何想法如何做到这一点?
答
$(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."
P.S.它是“e.preventDefault();” ...你忘了“。”在你的代码中。
我试试这个。但看起来它不工作,并禁用“moztouchmove”后,页面仍然滚动。 – WaiLam 2011-04-22 11:25:38
基本上,我也想禁用手势来显示标签栏/工具栏。现在,他们会在左/右滑动时显示。 – WaiLam 2011-04-22 11:36:21