From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../ja/web/api/htmlelement/offsetheight/index.html | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 files/ja/web/api/htmlelement/offsetheight/index.html (limited to 'files/ja/web/api/htmlelement/offsetheight') diff --git a/files/ja/web/api/htmlelement/offsetheight/index.html b/files/ja/web/api/htmlelement/offsetheight/index.html new file mode 100644 index 0000000000..b2b4037ecc --- /dev/null +++ b/files/ja/web/api/htmlelement/offsetheight/index.html @@ -0,0 +1,72 @@ +--- +title: HTMLElement.offsetHeight +slug: Web/API/HTMLElement/offsetHeight +tags: + - API + - CSSOM View + - Property + - Reference +translation_of: Web/API/HTMLElement/offsetHeight +--- +
{{ APIRef("HTML DOM") }}
+ +

HTMLElement.offsetHeight 読み取り専用プロパティは、垂直パディングや境界線を含む要素の高さを整数として返します。

+ +

通常、offsetHeight は、境界線、パディング、および水平スクロールバー(レンダリングされている場合)を含む、要素の CSS height のピクセル単位の測定値です。 ::before::after などの擬似要素の高さは含まれません。 ドキュメントの body オブジェクトの場合、測定値には、要素の CSS height ではなく、線形コンテンツの高さの合計が含まれます。 他の線形コンテンツの下に広がる浮動要素は無視されます。

+ +

(例えば、要素またはその祖先のいずれかで style.display"none" に設定することにより)要素が非表示の場合、0 が返されます。

+ +
+

このプロパティは、値を整数に丸めます。 小数値が必要な場合は、{{ domxref("element.getBoundingClientRect()") }} を使用します。

+
+ +

構文

+ +
var intElemOffsetHeight = element.offsetHeight;
+ +

intElemOffsetHeight は、要素の offsetHeight ピクセル値に対応する整数を格納する変数です。 offsetHeight プロパティは読み取り専用です。

+ +

+ +

             Image:Dimensions-offset.png

+ +

上のサンプル画像は、スクロールバーにより、ウィンドウに収まる場合の offsetHeight を示しています。 ただし、スクロールできない要素には、目に見えるコンテンツよりもはるかに大きい大きな offsetHeight 値が含まれる場合があります。 これらの要素は通常、スクロール可能な要素内に含まれています。 その結果、これらの非スクロール要素は、スクロール可能なコンテナの scrollTop の設定に応じて、完全にまたは部分的に非表示になる場合があります。

+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('CSSOM View', '#dom-htmlelement-offsetheight', 'offsetHeight')}}{{Spec2('CSSOM View')}}
+ +

ノート

+ +

offsetHeight は、MSIE によって最初に導入された DHTML オブジェクトモデルのプロパティです。 要素の物理的/グラフィカルな寸法、または要素の境界ボックスの高さ(border-box height)と呼ばれることもあります。

+ +

ブラウザーの互換性

+ + + +

{{Compat("api.HTMLElement.offsetHeight")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf