DeviceOrientationEvent.beta

Baseline 2023

Newly available

Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

返回设备旋转时 X 轴的值。即:角度的数值,范围介于 -180 ------ 180 之间 表示设备正在向前或向后倾斜。更多信息见 方向和运动数据详解

语法

var beta = instanceOfDeviceOrientationEvent.beta;

规范

Specification
Device Orientation and Motion
# ref-for-dom-deviceorientationevent-beta②

浏览器的兼容性

BCD tables only load in the browser

参见