Window Properties - Usage

window.js defines the following functions:

getInnerHeight()

Synopsis

getInnerHeight(window)

Arguments

window

A reference to a window.

Returns

The inner height of the window (excluding chrome).

Description

getInnerHeight() is a convenience function that gets the inner height of the window in a cross-browser way. In Mozilla and other true CSS compliant browsers, this represents the window height as opposed to the height of the document within the window.

getInnerWidth()

Synopsis

getInnerWidth(window)

Arguments

window

A reference to a window.

Returns

The inner width of the window (excluding chrome).

Description

getInnerWidth() is a convenience function that gets the inner width of the window in a cross-browser way.

getScrollLeft()

Synopsis

getScrollLeft(window)

Arguments

window

A reference to a window.

Returns

The distance to the left that the window has been scrolled in pixels.

Description

getScrollLeft() is a convenience function that gets the horizontal scroll distance of the window in a cross-browser way.

getScrollTop()

Synopsis

getScrollTop(window)

Arguments

window

A reference to a window.

Returns

The distance downwards that the window has been scrolled in pixels.

Description

getScrollTop() is a convenience function that gets the vertical scroll distance of the window in a cross-browser way.

More about this script

Related to this script

Licensing

This script is released under a Creative Commons License.