TOC PREV NEXT INDEX

Gecko DOM Reference

window.innerWidth

Width of the browser window viewport including, if rendered, the vertical scrollbar.

Syntax

var intViewportWidth = window.innerWidth;

Values

The window.innerWidth property is read-only; it has no default value.
window.innerWidth property stores an integer representing a number of pixels.

Notes

The innerWidth property will be supported in any window object like a window, a frame, a frameset or a secondary window.

Assuming a frameset
-------------------

var intFrameWidth = window.innerWidth;// or
var intFrameWidth = self.innerWidth;// will return the 
width of the frame viewport within the frameset
var intFramesetWidth = parent.innerWidth;// will return the
width of the viewport of the closest frameset
var intOuterFramesetWidth = top.innerWidth;// will return the
width of the viewport of the outermost frameset

See also window.outerWidth window.innerHeight, window.outerHeight.

Instructions: observe the effects of the following manoeuvers on several window properties

window.outerWidth
window.innerWidth
window.outerHeight
window.innerHeight

Standards information

DOM Level 0. Not part of any W3C technical specification or recommendation.


TOC PREV NEXT INDEX