You are here: Reference > JavaScript > client-side > box and rectangle

Box and Rectangle objects

Related objects:

Object Support Description
BoxObject
Contains information about the position of an element in the document hierarchy, and the position in the current window.
TextRectangle
39.54
Represents the bounding rectangle of an element or TextRange object.
TextRectangles
39.54
Represents a collection of TextRectangle objects that specifies the exact shape of an element or TextRange object.

Related properties:

Property Support Description
bottom
(TextRectangle)
39.54
Returns a floating-point number in Firefox and an integer in other browsers that specifies the bottom position of the rectangle, in pixels.
element
(BoxObject)
Returns a reference to the element that the BoxObject was created from.
height
(BoxObject)
Returns an integer that specifies the height of the element's rounding box, in pixels.
height
(TextRectangle)
93.54
Returns a floating-point number in Firefox and an integer in other browsers that specifies the height of the rectangle, in pixels.
left
(TextRectangle)
39.54
Returns a floating-point number in Firefox and an integer in other browsers that specifies the left position of the rectangle, in pixels.
length
(TextRectangles)
39.54
Returns an integer that specifies the number of objects in the current collection.
parentBox
(BoxObject)
Returns a reference to the parent of the element that the BoxObject was created from.
right
(TextRectangle)
39.54
Returns a floating-point number in Firefox and an integer in other browsers that specifies the right position of the rectangle, in pixels.
screenX
(BoxObject)
Returns an integer that specifies the left position of the element relative to the screen upper-left corner, in pixels.
screenY
(BoxObject)
Returns an integer that specifies the top position of the element relative to the screen upper-left corner, in pixels.
top
(TextRectangle)
39.54
Returns a floating-point number in Firefox and an integer in other browsers that specifies the top position of the rectangle, in pixels.
width
(BoxObject)
Returns an integer that specifies the width of the element's rounding box, in pixels.
width
(TextRectangle)
93.54
Returns a floating-point number in Firefox and an integer in other browsers that specifies the width of the rectangle, in pixels.
x
(BoxObject)
Returns an integer that specifies the left position of the element relative to the document upper-left corner, in pixels.
y
(BoxObject)
Returns an integer that specifies the top position of the element relative to the document upper-left corner, in pixels.

Related methods:

Method Support Description
getBoundingClientRect
39.54
Returns a TextRectangle object that specifies the bounding rectangle of the current element or TextRange object, in pixels, relative to the upper-left corner of the browser's client area.
getBoxObjectFor
(document)
3.6
Returns a BoxObject object that represents the bounding rectangle of the specified element in pixels, relative to the upper-left corner of the document.
getClientRects
39.54
Retrieves a TextRectangles collection that specifies the exact shape of the current element or TextRange object.
item
(TextRectangles)
39.54
Returns an object from the current collection by index.
User Contributed Comments

Post Content

Post Content