Andrew Florko
Andrew Florko

Reputation: 7750

Html: how to calculate layout boundaries

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!

Upvotes: 0

Views: 296

Answers (1)

Castrohenge
Castrohenge

Reputation: 8983

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.

Upvotes: 1

Related Questions