点击事件和点击事件之间有什么区别? [英] What is the difference between the click and tap events?

查看:182
本文介绍了点击事件和点击事件之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发可在Android/iOS和台式计算机上运行的应用程序.

I am developing an app that runs on Android/iOS and desktop computers.

我应该使用click还是tap事件?

它们之间有什么区别?

点击"是否可以在台式机上使用?如果没有,(并且我必须使用click)我是否错过了tap相对于click的任何优势?

Will the 'tap' work on desktop? if not, (and I have to use click) am I missing any advantages that the tap has over the click?

推荐答案

触摸事件和鼠标事件是完全不同的野兽.它们不可互换.

Touch events and mouse events are entirely different beasts. They are not interchangeable.

也就是说,我正在使用 jQuery Touch Punch ,它将触摸事件映射到其鼠标事件类似物,因此点击变得与点击相同.这样就可以使用所有标准jQuery UI优点,而不必进行任何特殊的触摸事件编程.它非常易于使用,到目前为止,对我来说,在iDevices和Android上都运行良好.

That said, I'm using jQuery Touch Punch which maps touch events to their mouse event analogs, so a tap becomes the same thing as a click. This makes it possibly to use all the standard jQuery UI goodness without having to do any special touch event programming. It's extremely simple to use, and so far has worked perfectly for me on both iDevices and Android.

这篇关于点击事件和点击事件之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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