views:

16

answers:

1

Is it possible to calculate boundaries for a html layout block?

For example there is

<div id="area">
...
</div>

and it's required to find out minimum size (width, height measured in pixels) to fit the #area into popup modal dialog.

How stable are these approiaches?

Thank you in advance!

+1  A: 

You could use jQuery's width and height functions.

See http://jsfiddle.net/AMdxG/1/

It works in FF and IE6/8 for me, so seems fairly stable.

Castrohenge