DeviceOrientationEvent object
Provides information about the physical orientation of the host device.
![]() |
DOM Information
Inheritance Hierarchy
Members
The DeviceOrientationEvent object has these types of members:
Methods
The DeviceOrientationEvent object has these methods.
| Method | Description |
|---|---|
| initDeviceOrientationEvent |
Used to create a DeviceOrientationEvent from JavaScript. |
Properties
The DeviceOrientationEvent object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read-only |
Returns true if absolute values for the alpha, beta, and gamma device orientation properties are provided, and false otherwise. | |
|
Read-only |
The amount of rotation (in the range of [0, 360)) around the Z axis, where Z is perpendicular to the screen, and positive out of the screen. | |
|
Read-only |
The amount of rotation (in the range of [-180, 180)) around the X axis, where X is in the plane of the screen, and positive towards the right hand side of the screen. | |
|
Read-only |
The amount of rotation (in the range of [-90, 90)) around the Y axis, where Y is in the plane of the screen, and positive towards the top of the screen. |
Standards information
Remarks
The data provided by the DeviceOrientationEvent object specifies the orientation of the host device in relation to a coordinate frame fixed on the Earth. Specifically, this Earth coordinate frame has the following three axes:
- East (X) is in the ground plane, perpendicular to the North axis and positive towards the East
- North (Y) is in the ground plane and positive towards True North (towards the North Pole).
- Up (Z) is perpendicular to the ground plane and positive upwards.
These X, Y, and Z axes correspond to the beta, gamma, and alpha properties of the DeviceOrientationEvent, respectively. Rotations use the right-hand rule, such that positive rotation around an axis is clockwise when viewed looking towards the positive direction of the axis.
See also
