Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

screen orientation and width&height

On mobile devices, if you open a keyboard then the above may fail, 
so can use screen.availHeight 
and screen.availWidth, which gives proper height and width even after 
the keyboard is opened.

if(screen.availHeight > screen.availWidth){
    alert("Please use Landscape!");
}

(screen.orientation || {}).type ||
    // @ts-ignore
    screen.mozOrientation ||
    // @ts-ignore
    screen.msOrientation;
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add picture to picture video js in old library in js 
Javascript :: Wrong Model Name For Backbone: Code Still Runs 
Javascript :: Solution-1-Part-B--solution options for reverse bits algorithm js 
Javascript :: Backbone Collection Example 
Javascript :: how to get event from iframe 
Javascript :: jquery try catch 
Javascript :: convert string to number 
Javascript :: how to check leap year in javascript 
Javascript :: number of factors 
Javascript :: timezone using javascript 
Javascript :: change your favicon in javascript 
Javascript :: dynamic styles in react native 
Javascript :: javasript array 
Javascript :: jsx attributes 
Javascript :: find all the prime numbers in the array 
Javascript :: javascript json to excel 
Javascript :: flatpickr current date set to text field 
Javascript :: createReadStream axios 
Javascript :: ref.current.selectionStart 
Javascript :: javascript Implicit Conversion to Number 
Javascript :: javascript + Operator with Numbers 
Javascript :: javascript typeof operator returns function 
Javascript :: JavaScript Iterables 
Javascript :: node js - excecute a child process and exchange message to and from 
Javascript :: bootstrap on tabs change 
Javascript :: set angle in phaser 
Javascript :: phaser spread 
Javascript :: closre in js 
Javascript :: file size to string js 
Javascript :: add filter category to react native flatslit 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =