Skip to content

Instantly share code, notes, and snippets.

@baptistebriel
Last active August 29, 2015 14:14
Show Gist options
  • Save baptistebriel/41a3a0d0afe0c606dbd8 to your computer and use it in GitHub Desktop.
Save baptistebriel/41a3a0d0afe0c606dbd8 to your computer and use it in GitHub Desktop.
screen.orientation
if (screen.lockOrientation) {
screen.lockOrientation('portrait-primary');
}
else if (screen.mozLockOrientation) {
screen.mozLockOrientation('portrait-primary');
}
else if (screen.orientation && screen.orientation.lock) {
screen.orientation.lock('portrait-primary');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment