tiltX
只读特性在
PointerEvent
interface is the angle (in degrees) between the
Y-Z plane
of the pointer and the screen. This property is typically only useful for a pen/stylus pointer type.
For an illustration of this property see Figure 2 in the specification .
var tiltX = pointerEvent.tiltX;
tiltX
-90
to
90
, inclusive, where a positive value is a tilt to the right. For devices that do not support this property, the value is
0
.
This example illustrates simple accessing of the
tiltX
and
tiltY
特性。
someElement.addEventListener("pointerdown", function(event) {
process_tilt(event.tiltX, event.tiltY);
}, false);
| 规范 | 状态 | 注释 |
|---|---|---|
|
指针事件 – 2 级
The definition of 'tiltX' in that specification. |
推荐 | 非稳定版本。 |
|
指针事件
The definition of 'tiltX' in that specification. |
过时 | 初始定义。 |
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 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
tiltX
|
Chrome 55 | Edge 12 |
Firefox
59
|
IE 10 | Opera 42 | Safari 13 | WebView Android 55 | Chrome Android 55 | Firefox Android 41 | Opera Android 42 | Safari iOS 13 | Samsung Internet Android 6.0 |
完整支持
用户必须明确启用此特征。
PointerEvent
Element.ongotpointercapture
Element.onlostpointercapture
Element.releasePointerCapture()
Element.setPointerCapture()
GlobalEventHandlers.onpointercancel
GlobalEventHandlers.onpointerdown
GlobalEventHandlers.onpointerenter
GlobalEventHandlers.onpointerleave
GlobalEventHandlers.onpointermove
GlobalEventHandlers.onpointerout
GlobalEventHandlers.onpointerover
GlobalEventHandlers.onpointerup
Navigator.maxTouchPoints