UI Events
GestureEvent 是 WebKit 的专有接口,提供多点触控的信息。这个接口的事件包括 Element/gesturestart_event、Element/gesturechange_event 和 Element/gestureend_event.
GestureEvent 继承自 UIEvent,后者又继承自 Event。
构造函数
- GestureEvent.GestureEvent
- : Creates a
GestureEventobject.
- : Creates a
属性
This interface also inherits properties of its parents, UIEvent and Event.
- GestureEvent.rotation
- : Change in rotation (in degrees) since the event's beginning. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. Initial value:
0.0
- : Change in rotation (in degrees) since the event's beginning. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. Initial value:
- GestureEvent.scale
- : Distance between two digits since the event's beginning. Expressed as a floating-point multiple of the initial distance between the digits at the beginning of the gesture. Values below 1.0 indicate an inward pinch (zoom out). Values above 1.0 indicate an outward unpinch (zoom in). Initial value:
1.0
- : Distance between two digits since the event's beginning. Expressed as a floating-point multiple of the initial distance between the digits at the beginning of the gesture. Values below 1.0 indicate an inward pinch (zoom out). Values above 1.0 indicate an outward unpinch (zoom in). Initial value:
方法
This interface also inherits methods of its parents, UIEvent and Event.
- GestureEvent.initGestureEvent()
- : Initializes the value of an
GestureEvent. If the event has already being dispatched, this method does nothing.
- : Initializes the value of an
手势事件类型
- Element/gesturestart_event
- Element/gesturechange_event
- Element/gestureend_event
规范
不属于任何规范。苹果在 Safari Developer Library 中描述了这个接口。
浏览器兼容性
参见
- MSGestureEvent
- Element/MSGestureStart_event
- Element/MSGestureEnd_event
- Element/MSGestureTap_event
- Element/MSGestureHold_event
- Element/MSGestureChange_event
- Element/MSInertiaStart_event
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
