iPad 对 JavaScript 单击事件采用三点触摸

发布于 2024-12-07 14:46:57 字数 260 浏览 2 评论 0原文

我的 iPad 有问题。我在 JavaScript 中使用 3 个函数作为锚标记:onmouseoveronmouseoutonclick

但是当我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零度° 2024-12-14 14:46:57

要完全支持带有触摸屏的移动设备,您无法使用鼠标事件...您需要更改为触摸事件

http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/

另一种方法是使用移动框架来划分代码,例如 jQTouch, jQMobile,等等...

它们开箱即用地支持鼠标事件和触摸事件。

当您的代码支持触摸事件后,甚至拖放也能很好地工作

在 iPad 上拖放

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

Drag and drop on iPad

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文