此方法对可见和隐藏元素均有效。
outerHeight(options)
optionsBoolean默认值:'false'
设置为 true 时,计算边距在内。
描述:
获取第一段落外部高度。
HTML 代码:
复制代码 代码如下:
Hello
2nd Paragraph
jQuery 代码:
复制代码 代码如下:
var p = $("p:first");
$("p:last").text( "outerHeight:" + p.outerHeight() + " , outerHeight(true):" + p.outerHeight(true) );
结果:
复制代码 代码如下:
Hello
outerHeight: 35 , outerHeight(true):55



