How to get window width and height by Javascript?
Get the current frame's height and width:
var w = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
var h = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
Definition and Usage
The innerWidth property returns the width of a window's content area.
The innerHeight property returns the height of a window's content area.
These properties are read-only.
Note: For IE8 and earlier, you can use the clientWidth and clientHeight properties
We are Recommending you:
How to preview link with iframe and javascript?
Sunday 10th of January 2021 05:58:27 PM
javascript
How to add class and remove class in javascript?
Thursday 7th of January 2021 03:35:21 PM
Javascript