, jQuery, :
$(document).ready(function(){
$("#container").height();
});
, height jQuery.
:
, .hight() , , CSS-.
, , , .
, , , , , :
innerHeight()
$(document).ready(function(){
$("#container").innerHeight();
});
, , .
outerHeight()
$(document).ready(function(){
$("#container").outerHeight();
$("#container").outerHeight(true);
});
, , , ( true ).
. DEMO
, 300px div. , css margin-top 20px, padding-top 50px, 5px, .
- ()
, jQuery height() 300 , , css.
- innerHeight()
, jQuery innerHeight() 350 , 300 div + 50 .
- externalHeight()
Notice how jQuery outerHeight()returns 360 pixels, which is 300 of div + 50 for padding + 10 for border (5 bottoms and 5 tops).
Demo output for externalHight (true)
Notice how jQuery outerHeight(true)returns 380 pixels, which is 300 from div + 50 for padding + 10 for border (5 bottom and 5 top) + 20 from the field.
source
share