JavaScripture
Contribute via GitHub Feedback

JavaScript ClientRect : Object

ClientRect describes a rectangular region an element occupies in the viewport. The Element.getBoundingClientRect() method returns a ClientRect containing the position of the Element. Element.getClientRects() returns a ClientRectList containing a list of ClientRects for each portion of the Element (ie, a text Element may have multiple rects if it was split across 2 lines).

Instance Properties

bottom : Number

The distance of the element to the bottom of the viewport.

height : Number

The height of the element.

left : Number

The distance of the element to the left of the viewport.

right : Number

The distance of the element to the right of the viewport.

top : Number

The distance of the element to the top of the viewport.

width : Number

The width of the element.