Export (0) Print
Expand All

DeviceOrientationEvent object

Provides information about the physical orientation of the host device.

IE11

 

DOM Information

Inheritance Hierarchy

 Event
   DeviceOrientationEvent

Members

The DeviceOrientationEvent object has these types of members:

Methods

The DeviceOrientationEvent object has these methods.

MethodDescription
initDeviceOrientationEvent

Used to create a DeviceOrientationEvent from JavaScript.

 

Properties

The DeviceOrientationEvent object has these properties.

PropertyAccess typeDescription

absolute

Read-only

Returns true if absolute values for the alpha, beta, and gamma device orientation properties are provided, and false otherwise.

alpha

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.

beta

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.

gamma

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

DeviceMotionEvent

 

 

Show:
© 2014 Microsoft