触摸启动与点击.引擎盖下会发生什么? [英] Touchstart vs Click. What happens under the hood?

查看:18
本文介绍了触摸启动与点击.引擎盖下会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,请原谅,这不是一个编程问题,但我认为它不适合理论 CSCS 非编程仍处于内测阶段.

First, excuse me please, this is not a programming question, but I think it wont fit to Theoretical CS, and CS Non Programming is still in private Beta.

更新我的phonegap应用程序后收听

after updating my phonegap Applications to listen to

$(selector).bind("touchstart",function());

$(selector).bind("touchstart",function());

代替

$(selector).click(function());

$(selector).click(function());

(这里使用 jquery),并且性能显着提高,我想知道 touchstart 有什么不同,尽管它可能是专为移动设备环境设计的.我查了一下 w3c 文档 on touchstart,但没有提供任何信息.

(here with jquery),and the performance improved remarkably, I want to know what touchstart does different, despite of the fact that it is probably designed especially for mobile devices environments. I looked up the w3c document on touchstart, but it doesnt provide any information.

如果有人有进一步解释的链接或可以解释它是如何工作的,我非常感谢

if anyone has a link to further explanation or can explain how it works, I greatly appreciate it

推荐答案

在 iPhone 上,只要手指触摸屏幕,touchstart 事件就会触发,而 click在您触摸屏幕并将手指从屏幕上移开 300 毫秒后触发事件.300 毫秒的时间延迟是为了让 Safari 可以等待,看看您是否打算连续双击屏幕以模拟缩放手势.

On the iPhone the touchstart event fires as soon as your finger touches the screen, whereas the click event fires 300 ms after you touch the screen and lift you finger off the screen. The 300 ms time delay is so that Safari can wait to see if you intend to double tap the screen in succession to simulate the zoom gesture.

这篇关于触摸启动与点击.引擎盖下会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆