Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Testing
- Loading branch information
Joel Salisbury
committed
Jan 21, 2016
1 parent
5058b8f
commit 9c5448a
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if (window.DeviceMotionEvent) { | ||
window.addEventListener('devicemotion', deviceMotionHandler, false); | ||
} else { | ||
document.getElementById("warning").innerHTML = "Not supported." | ||
} | ||
|
||
|
||
function deviceMotionHandler(eventData) { | ||
// Grab the acceleration from the results | ||
var acceleration = eventData.acceleration; | ||
$("#accelerationX").html(acceleration.x); | ||
|
||
} |