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 |
|
Represents the bounding rectangle of an element or TextRange object. | ||||||||||
TextRectangles |
|
Represents a collection of TextRectangle objects that specifies the exact shape of an element or TextRange object. |
Related properties:
Property | Support | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
bottom (TextRectangle) |
|
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) |
|
Returns a floating-point number in Firefox and an integer in other browsers that specifies the height of the rectangle, in pixels. | ||||||||||
left (TextRectangle) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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 |
|
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) |
|
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 |
|
Retrieves a TextRectangles collection that specifies the exact shape of the current element or TextRange object. | ||||||||||
item (TextRectangles) |
|
Returns an object from the current collection by index. |
User Contributed Comments