Created
June 12, 2013 19:55
-
-
Save matthewlehner/5768545 to your computer and use it in GitHub Desktop.
Experiments with deviceorientation.
This file contains hidden or 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
| window.addEventListener('deviceorientation', function(eventData) { | |
| // The compass direction - will return a value between 0 and 360 | |
| eventData.alpha | |
| // Side to side value - will return a value between -180 and 180 | |
| eventData.beta | |
| // Front to back value - will return a value between -90 and 90 | |
| eventData.gamma | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment