触摸屏事件的文档

触摸屏事件的文档

本文介绍了JavaScript中触摸屏事件的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里可以找到JavaScript中的触摸屏事件的文档或参考,例如。 touchstart。



我发现这个有用的链接(编辑:页面不再存在)在iPhone上提到事件touchstart,touchmove和touchend。



有更多吗?黑莓和Android呢?我没有在SO和Google上找到很多东西。



修改
这是Apple的一个很好的文档:

解决方案

我在开发移动设备时使用本网站网路应用程式



但是随着研究我得到了一个体面的列表。




  • touchstart

    • 动作:触发屏幕时触发(将触发多个$ / $>

    • >
    • 动作:手指从屏幕上提起时触发(实际上是单点触摸)

    • 等效:mouseup


  • touchmove

    • 动作:当一个或多个手指在屏幕上移动时触发

    • 等效:mousemove


  • touchcancel

    • 动作:触摸事件由系统取消

    • 等效:没有我知道




其他触摸设备将触摸事件映射到鼠标事件,其他人忽略触摸事件。



对于 - 除了移动Safari,还有没有办法在触摸屏上的
桌面上访问触摸事件。


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/iphone-touch-events-in-javascript/ (EDIT: page no longer exists) where the events "touchstart", "touchmove" and "touchend" are mentioned for IPhone.

Are there more? What about Blackberry and Android? I did not find much on SO and Google.

EditHere is a good documentation by Apple: http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

解决方案

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 ondesktops that have a touch screen."

这篇关于JavaScript中触摸屏事件的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 07:37