Middletone
Middletone

Reputation: 4270

How do I programatically determine how tall a div tag will be when rendered?

I'd like to be able to load a page up and once all the content is added see how high it is and include that as a hidden parrameter to be picked up later. Is there a way to do this?

[NOTE] Just to clarify, I have to do this n code behind because it has to be retrieved via webrequest object.

Upvotes: 0

Views: 105

Answers (1)

c_harm
c_harm

Reputation:

Sure thing. With jQuery:

$('#item').data('height', $('#item').height() );

#item's height (in the box model sense, not including padding) will be stored by $().data as a property of itself available for later JavaScripting.

Upvotes: 2

Related Questions