Skip to content

Instantly share code, notes, and snippets.

@topherPedersen
Created September 26, 2019 07:44
Show Gist options
  • Save topherPedersen/b949cd3ed5618d751465bf12bbe88422 to your computer and use it in GitHub Desktop.
Save topherPedersen/b949cd3ed5618d751465bf12bbe88422 to your computer and use it in GitHub Desktop.
Lock Device Orientation in an Apache Cordova (using plugin)
// Lock Device Orientation
function lockDeviceOrientationCallback() {
// set to either landscape
screen.orientation.lock('portrait');
console.log("locking device orientation...");
}
document.addEventListener("deviceready", lockDeviceOrientationCallback, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment