initDeviceOrientationEvent method
Used to create a DeviceOrientationEvent from JavaScript.
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() |
Syntax
DeviceOrientationEvent.initDeviceOrientationEvent(type, canBubble, cancelable, alpha, beta, gamma, absolute);Parameters
- type [in]
-
Type: DOMString
The type of the event being created
- canBubble [in]
-
Type: boolean
Indicates whether the event can bubble. When true the event should propagate upward. When false the event does not propagate upward.
- cancelable [in]
-
Type: boolean
Indicates whether the event’s default action can be prevented. When true, the default action can be canceled. When false, the default action cannot be canceled.
- alpha [in]
-
Type: double
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 [in]
-
Type: double
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 [in]
-
Type: double
The amount of rotation (in the range of [-90, 90)) around the X axis, where X is in the plane of the screen, and positive towards the right hand side of the screen.
- absolute [in]
-
Type: boolean
true if absolute values for the alpha, beta, and gamma device orientation properties are provided, false otherwise
Return value
This method does not return a value.
Standards information
See also
