GestureEvent

非标
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

GestureEvent is a proprietary interface specific to WebKit which gives information regarding multi-touch gestures. Events using this interface include gesturestart , gesturechange ,和 gestureend .

GestureEvent derives from UIEvent , which in turn derives from Event .

构造函数

GestureEvent()
创建 GestureEvent 对象。

特性

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
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

方法

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.

Gesture event types

规范

Not part of any specification. Apple has a description at the Safari Developer Library .

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
GestureEvent
非标
Chrome No Edge No Firefox No IE No Opera No Safari 9 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 2 Samsung Internet Android No
GestureEvent() 构造函数
非标
Chrome No Edge No Firefox No IE No Opera No Safari 9 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 2 Samsung Internet Android No
initGestureEvent
非标
Chrome No Edge No Firefox No IE No Opera No Safari 9 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 2 Samsung Internet Android No
rotation
非标
Chrome No Edge No Firefox No IE No Opera No Safari 9 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 2 Samsung Internet Android No
scale
非标
Chrome No Edge No Firefox No IE No Opera No Safari 9 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 2 Samsung Internet Android No

图例

完整支持
完整支持
不支持
不支持
非标。预期跨浏览器支持较差。
非标。预期跨浏览器支持较差。

另请参阅