From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/document/fullscreenenabled/index.html | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 files/ja/web/api/document/fullscreenenabled/index.html (limited to 'files/ja/web/api/document/fullscreenenabled') diff --git a/files/ja/web/api/document/fullscreenenabled/index.html b/files/ja/web/api/document/fullscreenenabled/index.html new file mode 100644 index 0000000000..56e5358fae --- /dev/null +++ b/files/ja/web/api/document/fullscreenenabled/index.html @@ -0,0 +1,79 @@ +--- +title: Document.fullscreenEnabled +slug: Web/API/Document/fullscreenEnabled +tags: + - API + - Document + - Fullscreen API + - Property + - Read-only + - Reference + - fullscreenEnabled + - プロパティ + - 全画面 + - 画面 +translation_of: Web/API/Document/fullscreenEnabled +--- +
{{APIRef("Fullscreen API")}}
+ +

{{domxref("Document")}} インターフェイスの fullscreenEnabled プロパティは読み取り専用で、全画面モードが使用できるかを示します。全画面モードは文書内にウィンドウ化されたプラグインを含まないページ、および文書内のすべての {{HTMLElement("iframe")}} 要素が {{HTMLAttrXRef("allowfullscreen", "iframe")}} 属性を持つページに限り使用することができます。

+ +

このプロパティは読み取り専用ですが、変更されても (strict モードでも) 例外を投げません。セッターは何もしないので、無視されます。

+ +

構文

+ +
var isFullscreenAvailable = document.fullscreenEnabled;
+
+ +

+ +

{{domxref("Boolean")}} 値であり、文書や要素が {{domxref("Element.requestFullscreen()")}} を呼び出すことで全画面モードに移行できるのであれば true です。全画面モードが利用できないのであれば、値は false になります。

+ +

+ +

この例では、 {{htmlElement("video")}} 要素に全画面モードへの移行を試みる前に fullscreenEnabled の値をチェックし、利用できない場合には移行を試みないようにします。

+ +
function requestFullScreen() {
+  if (document.fullscreenEnabled) {
+    videoElement.requestFullScreen();
+  } else {
+    console.log('現在ブラウザーは全画面モードを使用することができません');
+  }
+}
+ +

仕様書

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

ブラウザーの対応

+ + + +

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

+ +

関連情報

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