Tuesday, November 15, 2016

browser window's height and width

A practical JavaScript solution (covering all browsers):
var w = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;

var h = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
--------------------------------------------------
The example displays the browser window's height and width: (NOT including toolbars/scrollbars)

 http://www.w3schools.com/js/js_window.asp

No comments:

Post a Comment