From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/document/width/index.html | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 files/ja/web/api/document/width/index.html (limited to 'files/ja/web/api/document/width/index.html') diff --git a/files/ja/web/api/document/width/index.html b/files/ja/web/api/document/width/index.html new file mode 100644 index 0000000000..519fce7b1b --- /dev/null +++ b/files/ja/web/api/document/width/index.html @@ -0,0 +1,59 @@ +--- +title: Document.width +slug: Web/API/Document/width +tags: + - API + - Document + - HTML DOM + - Obsolete + - Reference + - width + - プロパティ +translation_of: Web/API/Document/width +--- +
{{APIRef("DOM")}} {{Obsolete_header}}
+ +
+

メモ: {{Gecko("6.0")}} より document.width には対応しなくなりました。代わりに document.body.clientWidth を使用してください。 {{domxref("element.clientWidth")}} を参照して下さい。

+
+ +

現在の文書の {{HTMLElement("body")}} 要素の現在の幅をピクセル値で返します。

+ +

Internet Explorer では対応していません。

+ +

構文

+ +
pixels = document.width;
+
+ +

+ +
function init() {
+  alert("文書の幅は " + document.width + " ピクセルです。");
+}
+
+ +

代替策

+ +
document.body.clientWidth              /* <body> の幅 */
+document.documentElement.clientWidth   /* <html> の幅 */
+window.innerWidth                      /* window の内寸幅 */
+
+ +

仕様書

+ +

HTML5

+ +

ブラウザーの対応

+ + + +

{{Compat("api.Document.width")}}

+ +

関連情報

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