iPad 对 JavaScript 单击事件采用三点触摸
我的 iPad 有问题。我在 JavaScript 中使用 3 个函数作为锚标记:onmouseover
、onmouseout
、onclick
。
但是当我在iPad上测试它时,第一次触摸它会触发onmouseover
,然后又需要两次触摸才能执行onclick
事件。
这意味着点击事件总共需要三次触摸。一般来说,只需触摸两次即可。为什么会这样呢?
I have problem with iPad. I use 3 function in JavaScript for anchor tag, onmouseover
, onmouseout
, onclick
.
But when I test it on the iPad then for first touch it trigger onmouseover
, and then it takes two another touch for execute onclick
event.
That means it take total three touch for click event. Generally it has to take only two touch for it. Why is it so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要完全支持带有触摸屏的移动设备,您无法使用鼠标事件...您需要更改为触摸事件
http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/
另一种方法是使用移动框架来划分代码,例如 jQTouch, jQMobile,等等...
它们开箱即用地支持鼠标事件和触摸事件。
当您的代码支持触摸事件后,甚至拖放也能很好地工作
To fully support Mobile devices with their Touch Screens you can't use the mouse events... you need to change to touch events
http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/
Another way is to divide the code using a mobile Framework, like jQTouch, jQMobile, etc...
They support Mouse Events and Touch Events right out of the box.
After you make your code support for Touch Events, even Drag and Drop will work nicely