Created
September 26, 2019 07:44
-
-
Save topherPedersen/b949cd3ed5618d751465bf12bbe88422 to your computer and use it in GitHub Desktop.
Lock Device Orientation in an Apache Cordova (using plugin)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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