Documentation for touchscreen events in Javascript

前端 未结 1 768
Happy的楠姐
Happy的楠姐 2021-02-20 12:37

Where can I find documentation or a reference for touchscreen events in Javascript, ex. \"touchstart\".

I found this useful link http://ross.posterous.com/2008/08/19/ip

相关标签:
1条回答
  • 2021-02-20 13:37

    I used this site when developing a mobile web app http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/

    But with research I have gotten a decent list.

    • touchstart
      • Action: fires when the screen is touched (will fire for multi-point touches as well)
      • Equivalent: mousedown
    • touchend
      • Action: fires when a finger is lifted from a screen (is really finiky with single point touch
      • Equivalent: mouseup
    • touchmove
      • Action: fires when one or more fingers move on the screen
      • Equivalent: mousemove
    • touchcancel
      • Action: when a touch event is canceled by the system
      • Equivalent: none that I'm aware

    Other touch devices map the touch events to mouse events. Others ignore touch events.

    To a Google API discussion - "Apart from mobile safari, there isn't a way to access touch events on desktops that have a touch screen."

    0 讨论(0)
提交回复
热议问题