Inside JavaScript

The getBoundingClientRect Method

The getBoundingClientRect method is an Internet Explorer method that returns a TextRectangle object that holds the rectangle that the object appears in, called its bounding rectangle . You can see the support for this method in Table 6.24.

Table 6.24. The getBoundingClientRect Method

Method

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

getBoundingClientRect()

             

x

x

x

 

Returns: TextRectangle object

You can use the TextRectangle object's bottom , left , right , and top properties to get the actual bounding rectangle of an object.

Категории