Narayana Tutorial

Online Java Tutorial Blog

Category: JavaScript

JavaScript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.

How to detect the browser window size in JavaScript?

To determine the size of the browser window, use the following properties: in Internet Explorer (backward-compatibility mode): document.body.offsetWidth document.body.offsetHeight in Internet Explorer (standards mode, document.compatMode==’CSS1Compat’): document.documentElement.offsetWidth document.documentElement.offsetHeight in most other browsers – as well as IE9 (standards mode): window.innerWidth window.innerHeight (the page’s visible width/height) window.outerWidth window.outerHeight (the browser outer width/height) The following code sets the […]

Narayana Tutorial © 2016 Frontier Theme
Show Button
Hide Button