English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
outerWidthA read-only property that returns the width of the entire browser window (including the scroll bar) in pixels.
UsageinnerWidthProperty to get the width of the currently displayed page.
window.outerWidth
var h = window.outerHeight; var w = window.outerWidth;Test and See‹/›
The numbers in the table specify the first browser version that fully supports the outerWidth property:
Property | |||||
outerWidth | 1 | 1 | 9 | 3 | 9 |
Return Value: | A number representing the entire browser window width in pixels |
---|
This example shows innerWidth, innerHeight, outerWidth, and outerHeight in one example:
var txt = ""; txt += "<p>innerWidth: " + window.innerWidth + "</p>"; txt += "<p>innerHeight: " + window.innerHeight + "</p>"; txt += "<p>outerWidth: " + window.outerWidth + "</p>"; txt += "<p>outerHeight: " + window.outerHeight + "</p>"; document.write(txt);Test and See‹/›
Reference: Window (Window)window.innerHeight property
Reference: Window (Window)window.innerWidth property
Reference: Window (Window)window.outerHeight property