Advertisement
nrzmalik

Portrait Screen Orientation Lock in Articulate Storyline (JavaScript)

Mar 2nd, 2023
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.30 KB | Source Code | 0 0
  1. // Lock screen orientation to portrait mode
  2. screen.orientation.lock('portrait');
  3.  
  4. // Listen for orientation change events and prevent rotation
  5. window.addEventListener("orientationchange", function() {
  6.   if (screen.orientation.angle !== 0) {
  7.     screen.orientation.lock('portrait');
  8.   }
  9. }, false);
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement