【问题标题】:Can I make onclick fire after mousedown, but before mouseup event?我可以在 mousedown 之后但在 mouseup 事件之前触发 onclick 吗?
【发布时间】:2016-12-09 04:27:15
【问题描述】:

我需要在 touchstart 之后和 touchend 之前播放音频(通过用手指按住按钮)。它适用于 Android,但 iOS 需要 onclick 事件才能开始播放。 有没有办法改变这个事件的顺序?

谢谢

【问题讨论】:

  • 按定义,单击是鼠标按下,然后鼠标向上。

标签: javascript


【解决方案1】:

没有。

您必须使用 onmousedown 和 onmouseup 事件。

<p onmousedown="myFunction()">Click the text!</p>
<p onmouseup="mouseUp()">Click the text!</p>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-22
    • 2016-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多