Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mattdsteele
Last active October 30, 2016 12:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattdsteele/5615925 to your computer and use it in GitHub Desktop.
Save mattdsteele/5615925 to your computer and use it in GitHub Desktop.
Quirks in DeviceOrientation API

Nexus S, Android 4.1.1

Firefox Beta 22.0

  • Alpha increases when rotating device clockwise
  • absolute: true
  • Alpha is at 0° when device is exactly north

Chrome Beta 28.0.1500.31

  • Alpha increases when rotating device counterclockwise
  • absolute: true
  • Alpha is at 0° when device is approximately north

Android Browser 4.1.1

  • Alpha increases when rotating device counterclockwise
  • absolute: undefined
  • Alpha is at 0° when device is exactly west

Opera Mobile 14.0.1074.58201

  • Alpha increases when rotating device counterclockwise
  • absolute: true
  • Alpha is at 0° when device is exactly north

iPhone 5, iOS 6.1.4

Mobile Safari

  • Alpha increases when rotating device counterclockwise
  • Alpha is at 0° where the page loads
  • Includes webkitCompassHeading property, which is at 0° when device is north
  • webkitCompassHeading increases when rotating device clockwise

iPhone 4S, iOS 6.1.3

Chrome 26.0.1410.53

  • Same as iPhone 5 Mobile Safari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment