css - Get html element rendered height with jQuery -
a simple question.
for example, have class this:
.someclass { font-size: 1.2em /* let's 1em set 10px in example */ padding: 1em 0 2em 0; border: 0.1em solid #000; }
and simple html use it:
<div class="someclass">test</div>
i generated height of element - computed height border , padding. using jquery .height()
method in example gives current value of line-height
property - expected, because text in div has 1 line.
i know calculations myself relatively simple i'd ask - there built-in solution in jquery?
jquery has several methods this. see http://api.jquery.com/category/dimensions/
in case, sounds want outerheight()
. http://api.jquery.com/outerheight/
Comments
Post a Comment