namespace document.viewport
Description
The document.viewport namespace contains methods that return information
about the viewport — the rectangle that represents the portion of a web
page within view. In other words, it's the browser window minus all chrome.
Class methods
-
getDimensions #
document.viewport.getDimensions() ⇒ ObjectReturns the size of the viewport.
Returns an object of the form
{ width: Number, height: Number }. -
getHeight #
document.viewport.getHeight() ⇒ NumberReturns the height of the viewport.
-
getScrollOffsets #
document.viewport.getScrollOffsets() ⇒ ArrayReturns the viewport's horizontal and vertical scroll offsets.
Returns an array in the form of
[leftValue, topValue]. Also accessible as properties:{ left: leftValue, top: topValue }. -
getWidth #
document.viewport.getWidth() ⇒ NumberReturns the width of the viewport.