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/document/exitfullscreen/index.html | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 files/ja/web/api/document/exitfullscreen/index.html (limited to 'files/ja/web/api/document/exitfullscreen') diff --git a/files/ja/web/api/document/exitfullscreen/index.html b/files/ja/web/api/document/exitfullscreen/index.html new file mode 100644 index 0000000000..0a9a5008f5 --- /dev/null +++ b/files/ja/web/api/document/exitfullscreen/index.html @@ -0,0 +1,89 @@ +--- +title: Document.exitFullscreen() +slug: Web/API/Document/exitFullscreen +tags: + - API + - DOM + - Document + - Full + - Full-screen + - Fullscreen API + - Method + - Reference + - exitFullscreen + - fullscreen + - screen + - メソッド + - 全画面 +translation_of: Web/API/Document/exitFullscreen +--- +
{{ApiRef("Fullscreen API")}}
+ +

{{domxref("Document")}} の exitFullscreen() メソッドは、この文書で現在全画面モードで表示されている要素が全画面モードを向け、画面を以前の状態に戻すことを要求します。これはふつう、以前の {{domxref("Element.requestFullscreen()")}} の呼び出しの効果を取り消します。

+ +

構文

+ +
exitPromise = document.exitFullscreen();
+
+ +

引数

+ +

なし。

+ +

返値

+ +

{{Glossary("user agent", "ユーザーエージェント")}}が全画面モードから完全に抜けたら解決される {{jsxref("Promise")}} です。全画面モードから抜けようとしてエラーが発生したら、 Promise の catch() ハンドラーが呼び出されます。

+ +

+ +

この例ではマウスボタンで中をクリックするたびに、現在の文書が全画面表示になったり戻ったりします。

+ +
document.onclick = function (event) {
+  if (document.fullscreenElement) {
+    document.exitFullscreen()
+      .then(() => console.log("Document Exited form Full screen mode"))
+      .catch((err) => console.error(err))
+  } else {
+    document.documentElement.requestFullscreen()
+  }
+}
+ +
+

注: もっと完全な例については、{{SectionOnPage("/ja/docs/Web/API/Element/requestFullScreen", "例")}}をご覧ください。

+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("Fullscreen", "#dom-document-exitfullscreen", "Document.exitFullscreen()")}}{{Spec2("Fullscreen")}}初回定義
+ +

ブラウザーの互換性

+ + + +

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

+ +

関連情報

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