Skip to content

Instantly share code, notes, and snippets.

@arnalyse
Created February 21, 2014 08:41
Show Gist options
  • Save arnalyse/9130767 to your computer and use it in GitHub Desktop.
Save arnalyse/9130767 to your computer and use it in GitHub Desktop.
iOS: detect device orientation
if (window.orientation == 90 || window.orientation == -90) {
myOrientation = 'landscape';
} else {
myOrientation = 'portrait';
}
// Nicos shorthand
if (window.orientation === Math.abs(90)) {
// …
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment