非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

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

GestureEvent 派生自 UIEvent ,依次派生自 事件 .

构造函数

GestureEvent()
创建 GestureEvent 对象。

特性

此接口还继承其父级的特性, UIEvent and 事件 .

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

方法

此接口还继承其父级方法, UIEvent and 事件 .

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 .

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
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
旋转 非标 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

图例

完整支持

完整支持

不支持

不支持

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

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

另请参阅

元数据

  • 最后修改: