移动应用中的Ghostclick [英] Ghostclicks in mobile apps
问题描述
ghost点击有很多资料/帖子,我想更好地理解它。所以我的理解方式,ghost点击的原因是点击
事件被调度〜300ms后触摸事件。 jQuery Mobile建议不要使用其 vclick $
There is a lot of material/posts on ghost clicks and I'm trying to understand it better. So the way I understand it, the reason for ghost clicks is the click
event being dispatched ~300ms after the touch event. jQuery Mobile suggests to not use their vclick
event whenever there is any chance of changing the content underneath the finger position.
我的第一个问题 会是:这意味着ghost点击只有在点击
的元素与最初触摸的元素不同时才会触发?所以,说,我写一个数据库条目,当一个按钮被触摸 - 没有别的。有没有鬼点击或没有机会。
My first question would be: Does that mean ghost clicks will only fire if the element targeted by click
is different from the one originally touched? So, say, I write a database entry when a button is touched – nothing else. Is there a chance of ghost clicking or not?
如果是这样,这不意味着我可以完全防止ghost点击,如果我只是使用只有 点击
活动且没有点击
活动?
If this is the case, wouldn't that mean that I can prevent ghost clicks altogether if I simply use only tap
events and no click
events whatsoever?
我的最后一个问题是,如果我可以告诉浏览器不使用300ms延迟,当使用PhoneGap(这将立即解决问题),但我只是猜想,我不能这样做,因为它可能
My last question would be if I can simply tell the browser to not use the 300ms delay when using PhoneGap (which would instantly solve the problem), but I'd just guess that I can't do that as it's probably hard-coded into the browser.
推荐答案
点击事件延迟300 ms,以检测双击或胖手指错误。
The click event is delayed by 300 ms to detect things like double tap or fat finger mistakes.
是的,尽可能使用触摸事件。
Yes, wherever possible you should use the touch events instead.
是的,通过做一点JS快速点击。例如:
Yes, there are many ways to enable fast clicks by doing a bit of JS. For instance:
- https://developers.google.com/mobile/articles/fast_buttons
- https://forum.jquery.com/topic/how-to-remove -the-300ms-delay-when-click-on-a-link-in-jquery-mobile
- http://labs.ft.com/2011/08/fastclick-native-like-tapping-for -touch-apps /
- https://developers.google.com/mobile/articles/fast_buttons
- https://forum.jquery.com/topic/how-to-remove-the-300ms-delay-when-clicking-on-a-link-in-jquery-mobile
- http://labs.ft.com/2011/08/fastclick-native-like-tapping-for-touch-apps/
您不必忍受300ms的延迟。
You don't have to live with the 300ms delay.
这篇关于移动应用中的Ghostclick的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!