mousedown JQuery 在 Android 触摸板上不起作用

发布于 12-23 02:50 字数 78 浏览 2 评论 0原文

我使用 mousedown 事件是希望当用户触摸该元素时它会起作用,但它似乎没有在 android 平板电脑上显示效果。我该如何解决这个问题?

I used mousedown event as hope that it will work when a user touches the element but it didn't seem to show the effect on andriod tablet. How do I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

陌伤浅笑2024-12-30 02:50:38

您可以尝试 onclick 鼠标处理程序。在触摸时,Android 首先触发所有触摸事件,然后触发鼠标事件以支持更多设备。因此,如果您想要更好的性能,也可以尝试“ontouchstart”和“ontouchend”。

You can try, onclick mouse handler. On a touch, Android first fires all touch events followed by mouse events to support more devices. Hence, if you want better performance, try "ontouchstart" and "ontouchend" as well.

森林很绿却致人迷途2024-12-30 02:50:38

通过使用不同的事件。我猜像 focus 这样的东西可能对你有用,但如果没有提到的目标就很难说。

By using a different event. I'd guess something like focus might do for you, but it is hard to say without the goal mentioned.

橙味迷妹2024-12-30 02:50:38

我认为使用 OnClick 事件您的问题将会得到解决。

I think using OnClick event your problem will get solve.

锦爱2024-12-30 02:50:38

这是因为当您触摸屏幕时,您不会触发 onmousedown 事件。
您应该尝试 onclick 或 ondrag 甚至 onmouseover。

that's because when you touch your screen you are not firing a onmousedown event.
You should try onclick or ondrag or maybe even onmouseover.

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