MSGestureEvent

非标
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.

MSGestureEvent is a proprietary interface specific to Internet Explorer and Microsoft Edge which represents events that occur due to touch gestures. Events using this interface include MSGestureStart , MSGestureEnd , MSGestureTap , MSGestureHold , MSGestureChange ,和 MSInertiaStart .

MSGestureEvent derives from UIEvent , which in turn derives from Event . Though the MSGestureEvent.initGestureEvent() method is kept for backward compatibility, the creation of an MSGestureEvent object should be done using the MSGestureEvent() 构造函数。

构造函数

MSGestureEvent()
创建 MSGestureEvent 对象。

特性

This interface also inherits properties of its parents, UIEvent and Event .

MSGestureEvent.expansion 只读
The diameter of the gesture area. For example, the distance between fingers.
MSGestureEvent.gestureObject 只读
返回 MSGesture object for this gesture event.
MSGestureEvent.rotation 只读
Amount of rotation (in radians) since the previous MSGestureEvent of the current gesture. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation.
MSGestureEvent.scale 只读
The difference in scale (for zoom gestures) from the previous MSGestureEvent of the current gesture.
MSGestureEvent.translationX 只读
Distance traversed along the X-axis since the previous MSGestureEvent of the current gesture
MSGestureEvent.translationY 只读
Distance traversed along the Y-axis since the previous MSGestureEvent of the current gesture
MSGestureEvent.velocityAngular 只读
Angular velocity. Expressed in radians.
MSGestureEvent.velocityExpansion 只读
The velocity of the expansion of the gesture area.
MSGestureEvent.velocityX 只读
Velocity along the direction of the X-axis.
MSGestureEvent.velocityY 只读
Velocity along the direction of the Y-axis.

方法

This interface also inherits methods of its parents, UIEvent and Event .

MSGestureEvent.initGestureEvent()
Initializes the value of an MSGestureEvent . If the event has already being dispatched, this method does nothing. This method is deprecated as of Microsoft Edge.

Gesture event types

规范

Not part of any specification. Microsoft has a description on MSDN .

浏览器兼容性

更新 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
MSGestureEvent
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
MSGestureEvent() 构造函数
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
expansion
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
gestureObject
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
initGestureEvent
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
rotation
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
scale
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
translationX
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
translationY
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
velocityAngular
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
velocityExpansion
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
velocityX
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
velocityY
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No

图例

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

另请参阅