HTML DOM TouchEvent
TouchEvent 对象
当用户触摸基于触控的设备时发生的事件属于 TouchEvent 对象。
Touch 事件属性和方法
属性/方法 | Description |
---|---|
altKey | 返回触摸事件被触发时是否按下了 "ALT" 键。 |
changedTouches | 返回在上一次触摸和这次触摸之间状态发生变化的所有触摸对象的列表。 |
ctrlKey | 返回触摸事件被触发时是否按下了 "CTRL" 键。 |
metaKey | 返回触摸事件被触发时是否按下了 "meta" 键。 |
shiftKey | 返回触摸事件被触发时是否按下了 "SHIFT" 键。 |
targetTouches | 返回包含仍然与触摸面接触的所有触摸点的 Touch 对象的 TouchList 列表。 |
touches | 返回当前与表面接触的所有 touch 对象的列表。 |
Event type
These event types belong to the TouchEvent object:
Event | Description |
---|---|
ontouchcancel | This event occurs when the touch is interrupted. |
ontouchend | This event occurs when the finger is removed from the touch screen. |
ontouchmove | This event occurs when the finger is dragged on the screen. |
ontouchstart | This event occurs when the finger is placed on the touch screen. |