Skip to content

Instantly share code, notes, and snippets.

@matthewlehner
Created June 12, 2013 19:55
Show Gist options
  • Select an option

  • Save matthewlehner/5768545 to your computer and use it in GitHub Desktop.

Select an option

Save matthewlehner/5768545 to your computer and use it in GitHub Desktop.
Experiments with deviceorientation.
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