首頁  >  CSS  > outerHeight([soptions])

返回值:IntegerouterHeight([options])

jQuery uterHeight() 方法概述

獲取第一個匹配元素外部高度(默認(rèn)包括補白和邊框)。

此方法對可見和隱藏元素均有效。

參數(shù)

optionsBoolean默認(rèn)值:'false'V1.2.6

設(shè)置為 true 時,計算邊距在內(nèi)。

示例

描述:

獲取第一段落外部高度。

HTML 代碼:
<p>Hello</p><p>2nd Paragraph</p>
jQuery 代碼:
var p = $("p:first");
$("p:last").text( "outerHeight:" + p.outerHeight() + " , outerHeight(true):" + p.outerHeight(true) );
結(jié)果:
<p>Hello</p><p>outerHeight: 35 , outerHeight(true):55</p>