jQuery outerHeight () method
Examples
Back <div> element External Height:
$("button").click(function(){
alert($("div").outerHeight());
});
alert($("div").outerHeight());
});
try it"
Definition and Usage
outerHeight () method returns the first matching element external height.
As shown in the following image, the method comprising the padding and border.
Tip: To include margin, please use outerHeight (true).
Related methods:
- width () - Sets or returns the width of the element
- height () - Sets or returns the height of an element
- innerWidth () - Returns the element's width (including padding)
- innerHeight () - Returns the height of an element (including padding)
- the outerWidth () - Returns the element's width (including padding and border)
grammar
$(selector).outerHeight( includeMargin )
参数 | 描述 |
---|---|
includeMargin | 可选。布尔值,规定是否包含 margin。
|
More examples
It contains margin
Whether to include provisions margin.
Display size by related methods
How to use the width (), height (), innerHeight (), innerWidth (), outerWidth () and outerHeight ().