jQueryのouterHeight()メソッド

❮jQueryHTML/ CSSメソッド

<div>要素の外側の高さを返します。

$("button").click(function(){
  alert($("div").outerHeight());
});

定義と使用法

outerHeight()メソッドは、最初に一致した要素の外側の高さを返します。

下の画像が示すように、この方法にはパディングとボーダーが含まれます。

ヒント:マージンを含めるには、outerHeight(true)を使用します。

jQueryディメンション


関連する方法:


構文

$(selector).outerHeight(includeMargin)

Parameter Description
includeMargin Optional. A Boolean value specifying whether or not to include the margin
  • false - Default. Does not include the margin
  • true - Includes the margin

自分で試してみてください-例


を含めるかどうかを指定します。


するwidth()、height()、innerHeight()、innerWidth()、outerWidth()、outerHeight()の使用方法。


❮jQueryHTML/ CSSメソッド