Name
ClientRect — an element bounding box
Synopsis
A ClientRect object describes a rectangle, using Window or
viewport coordinates. The getBoundingClientRect() method of Element returns objects of this kind to describe
the on-screen bounding box of an element. ClientRect objects are
static: they do not change when the element they describe
changes.
Properties
readonly floatbottomThe Y position, in viewport coordinates, of the bottom edge of the rectangle.
readonly floatheightThe height, in pixels, of the rectangle. In IE8 and before, this property is not defined; use
bottom-topinstead.readonly floatleftThe X position, in viewport coordinates, of the left edge of the rectangle.
readonly floatrightThe X position, in viewport coordinates, of the right edge of the rectangle.
readonly floattopThe Y position, in viewport coordinates, of the top edge of the rectangle.
readonly floatwidthThe width, in pixels, of the rectangle. In IE8 and before, this property is not defined; use
right-leftinstead.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access