initDeviceMotionEvent
Initializes a new device motion event.
Declaration
void initDeviceMotionEvent(
optional DOMString type,
optional boolean bubbles,
optional boolean cancelable,
optional Acceleration acceleration,
optional Acceleration accelerationIncludingGravity,
optional RotationRate rotationRate,
optional unrestricted double interval
);Parameters
- type:
The type of event. Pass
devicemotion. - bubbles:
Indicates whether this event is a bubbling event.
- cancelable:
Indicates whether this event can be canceled.
- acceleration:
The acceleration that the user is giving to the device. The
Accelerationobject hasx,y, andzproperties represented as doubles. - accelerationIncludingGravity:
The total acceleration of the device, which includes the user acceleration and the gravity. The
Accelerationobject hasx,y, andzproperties represented as doubles. - rotationRate:
The rotation rate of the device. The
RotationRateobject hasalpha,beta, andgammaproperties represented as doubles. - interval:
The interval in milliseconds since the last time this event was fired.