Compare Revisions

DeviceMotionEvent

Change Revisions

Revision 51766:

Revision 51766 by Sheppy on

Revision 51767:

Revision 51767 by tallowen on

Title:
DeviceMotionEvent
DeviceMotionEvent
Slug:
DOM/DeviceMotionEvent
DOM/DeviceMotionEvent
Tags:
DOM, Mobile, "Gecko DOM Reference", Motion
DOM, Mobile, "Gecko DOM Reference", Motion
Content:

Revision 51766
Revision 51767
n13    <h2>n13    <h2 id="Attributes">
n42    <h2>n42    <h2 id="Example">
n45    <p>n45    <pre class="script-jem">
46      &lt;coming soon&gt;46function handleMotionEvent(event) {
47    </p>47 
48    <h2>48    var x = event.accelerationIncludingGravity.x;
49    var y = event.accelerationIncludingGravity.y;
50    var z = event.accelerationIncludingGravity.z;
51 
52    // Do something awesome.
53}
54 
55window.addEventListener("devicemotion", handleMotionEvent, true);
56</pre>
57    <h2 id="See_also">
t51    <h2>t60    <h2 id="Specification">

Back to History