Skip to content Skip to sidebar Skip to footer

Get Absolute Height And Width

i have an html element and it has some css which are applied on it on the fly i want to know the exact height and width it takes after a new css class is applied. I tried offsetWid

Solution 1:

jQuery makes it easy for you: http://api.jquery.com/outerWidth/

Solution 2:

No, it can't be done in a cross-browser way: The point is, that you do not want to know the exact height and width of the element itself, but of the space it uses. This simply is a calculated value from the box model.

Either you need to calculate it yourself, or have a JS framework do it for you: Dojo and jQuery both have utility functions for that.

Post a Comment for "Get Absolute Height And Width"