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

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

问题描述

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

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

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

Should I use the click or the tap event?

它们之间有什么区别?

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.

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

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