From a617ec8afec43949849163167daaf51a60d2b298 Mon Sep 17 00:00:00 2001 From: MDN Date: Sun, 13 Feb 2022 00:57:20 +0000 Subject: [CRON] sync translated content --- files/ja/_redirects.txt | 4 + files/ja/_wikihistory.json | 50 ++++++------ .../api/element/fullscreenchange_event/index.html | 94 ++++++++++++++++++++++ .../api/element/fullscreenerror_event/index.html | 78 ++++++++++++++++++ .../api/window/gamepadconnected_event/index.html | 66 +++++++++++++++ .../window/gamepaddisconnected_event/index.html | 61 ++++++++++++++ .../web/api/element/onfullscreenchange/index.html | 93 --------------------- .../web/api/element/onfullscreenerror/index.html | 77 ------------------ .../web/api/window/ongamepadconnected/index.html | 65 --------------- .../api/window/ongamepaddisconnected/index.html | 60 -------------- files/ru/_redirects.txt | 2 + files/ru/_wikihistory.json | 24 +++--- .../api/window/gamepadconnected_event/index.html | 40 +++++++++ .../window/gamepaddisconnected_event/index.html | 39 +++++++++ .../web/api/window/ongamepadconnected/index.html | 39 --------- .../api/window/ongamepaddisconnected/index.html | 38 --------- files/zh-cn/_redirects.txt | 4 + files/zh-cn/_wikihistory.json | 50 ++++++------ .../api/window/gamepadconnected_event/index.html | 65 +++++++++++++++ .../api/element/fullscreenchange_event/index.html | 79 ++++++++++++++++++ .../api/element/fullscreenerror_event/index.html | 65 +++++++++++++++ .../web/api/element/onfullscreenchange/index.html | 78 ------------------ .../web/api/element/onfullscreenerror/index.html | 64 --------------- .../window/gamepaddisconnected_event/index.html | 52 ++++++++++++ .../web/api/window/ongamepadconnected/index.html | 64 --------------- .../api/window/ongamepaddisconnected/index.html | 51 ------------ 26 files changed, 711 insertions(+), 691 deletions(-) create mode 100644 files/ja/conflicting/web/api/element/fullscreenchange_event/index.html create mode 100644 files/ja/conflicting/web/api/element/fullscreenerror_event/index.html create mode 100644 files/ja/conflicting/web/api/window/gamepadconnected_event/index.html create mode 100644 files/ja/conflicting/web/api/window/gamepaddisconnected_event/index.html delete mode 100644 files/ja/web/api/element/onfullscreenchange/index.html delete mode 100644 files/ja/web/api/element/onfullscreenerror/index.html delete mode 100644 files/ja/web/api/window/ongamepadconnected/index.html delete mode 100644 files/ja/web/api/window/ongamepaddisconnected/index.html create mode 100644 files/ru/conflicting/web/api/window/gamepadconnected_event/index.html create mode 100644 files/ru/conflicting/web/api/window/gamepaddisconnected_event/index.html delete mode 100644 files/ru/web/api/window/ongamepadconnected/index.html delete mode 100644 files/ru/web/api/window/ongamepaddisconnected/index.html create mode 100644 files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html create mode 100644 files/zh-cn/web/api/element/fullscreenchange_event/index.html create mode 100644 files/zh-cn/web/api/element/fullscreenerror_event/index.html delete mode 100644 files/zh-cn/web/api/element/onfullscreenchange/index.html delete mode 100644 files/zh-cn/web/api/element/onfullscreenerror/index.html create mode 100644 files/zh-cn/web/api/window/gamepaddisconnected_event/index.html delete mode 100644 files/zh-cn/web/api/window/ongamepadconnected/index.html delete mode 100644 files/zh-cn/web/api/window/ongamepaddisconnected/index.html (limited to 'files') diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index bd6257cb70..60bd7befc2 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -3083,6 +3083,8 @@ /ja/docs/Web/API/Element/Activate_event /ja/docs/Web/API/Element/DOMActivate_event /ja/docs/Web/API/Element/accessKey /ja/docs/Web/API/HTMLElement/accessKey /ja/docs/Web/API/Element/name /ja/docs/Web/API +/ja/docs/Web/API/Element/onfullscreenchange /ja/docs/conflicting/Web/API/Element/fullscreenchange_event +/ja/docs/Web/API/Element/onfullscreenerror /ja/docs/conflicting/Web/API/Element/fullscreenerror_event /ja/docs/Web/API/Event/button /ja/docs/Web/API/MouseEvent/button /ja/docs/Web/API/Event/createEvent /ja/docs/Web/API/Document/createEvent /ja/docs/Web/API/EventHandler /ja/docs/Web/Events/Event_handlers @@ -3328,6 +3330,8 @@ /ja/docs/Web/API/Window/onclick /ja/docs/Web/API/GlobalEventHandlers/onclick /ja/docs/Web/API/Window/ondeviceproximity /ja/docs/orphaned/Web/API/Window/ondeviceproximity /ja/docs/Web/API/Window/onfocus /ja/docs/Web/API/GlobalEventHandlers/onfocus +/ja/docs/Web/API/Window/ongamepadconnected /ja/docs/conflicting/Web/API/Window/gamepadconnected_event +/ja/docs/Web/API/Window/ongamepaddisconnected /ja/docs/conflicting/Web/API/Window/gamepaddisconnected_event /ja/docs/Web/API/Window/oninstall /ja/docs/Web/API/Window/onappinstalled /ja/docs/Web/API/Window/onkeydown /ja/docs/Web/API/GlobalEventHandlers/onkeydown /ja/docs/Web/API/Window/onkeyup /ja/docs/Web/API/GlobalEventHandlers/onkeyup diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index f8b4b6cbc4..ea6f701c76 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -14020,18 +14020,6 @@ "Taken" ] }, - "Web/API/Element/onfullscreenchange": { - "modified": "2020-10-15T22:27:05.186Z", - "contributors": [ - "mfuji09" - ] - }, - "Web/API/Element/onfullscreenerror": { - "modified": "2020-10-15T22:27:05.707Z", - "contributors": [ - "mfuji09" - ] - }, "Web/API/Element/outerHTML": { "modified": "2020-10-15T21:49:26.268Z", "contributors": [ @@ -24511,19 +24499,6 @@ "mfuji09" ] }, - "Web/API/Window/ongamepadconnected": { - "modified": "2020-10-15T22:12:53.034Z", - "contributors": [ - "T.Ukegawa" - ] - }, - "Web/API/Window/ongamepaddisconnected": { - "modified": "2020-10-15T22:12:51.410Z", - "contributors": [ - "Potappo", - "T.Ukegawa" - ] - }, "Web/API/Window/open": { "modified": "2020-10-25T23:26:28.860Z", "contributors": [ @@ -48416,6 +48391,18 @@ "yyss" ] }, + "conflicting/Web/API/Element/fullscreenchange_event": { + "modified": "2020-10-15T22:27:05.186Z", + "contributors": [ + "mfuji09" + ] + }, + "conflicting/Web/API/Element/fullscreenerror_event": { + "modified": "2020-10-15T22:27:05.707Z", + "contributors": [ + "mfuji09" + ] + }, "conflicting/Web/API/File/name": { "modified": "2020-09-25T16:45:23.436Z", "contributors": [ @@ -48517,6 +48504,19 @@ "mfuji09" ] }, + "conflicting/Web/API/Window/gamepadconnected_event": { + "modified": "2020-10-15T22:12:53.034Z", + "contributors": [ + "T.Ukegawa" + ] + }, + "conflicting/Web/API/Window/gamepaddisconnected_event": { + "modified": "2020-10-15T22:12:51.410Z", + "contributors": [ + "Potappo", + "T.Ukegawa" + ] + }, "conflicting/Web/API/Window/scroll": { "modified": "2020-10-15T22:32:16.096Z", "contributors": [ diff --git a/files/ja/conflicting/web/api/element/fullscreenchange_event/index.html b/files/ja/conflicting/web/api/element/fullscreenchange_event/index.html new file mode 100644 index 0000000000..72f03279ee --- /dev/null +++ b/files/ja/conflicting/web/api/element/fullscreenchange_event/index.html @@ -0,0 +1,94 @@ +--- +title: Element.onfullscreenchange +slug: conflicting/Web/API/Element/fullscreenchange_event +tags: + - API + - Element + - Event Handler + - Full + - Full-screen + - Fullscreen API + - Property + - Reference + - fullscreen + - onfullscreenchange + - screen + - イベントハンドラー + - プロパティ + - 全画面 + - 全画面モード +translation_of: Web/API/Element/onfullscreenchange +original_slug: Web/API/Element/onfullscreenchange +--- +
{{ApiRef("Fullscreen API")}}
+ +

{{domxref("Element")}} インターフェイスの onfullscreenchange プロパティは、 {{domxref("Element/fullscreenchange_event", "fullscreenchange")}} イベントのイベントハンドラーで、要素が全画面モードへ移行するか、終了するときに発生します。

+ +

構文

+ +
targetDocument.onfullscreenchange = fullscreenChangeHandler;
+
+ +

+ +

{{event("fullscreenchange")}} イベントのイベントハンドラーで、要素が全画面モードへ移行または終了したことを示します。

+ +

+ +

この例では fullscreenchange イベントのハンドラーである handleFullscreenChange() を作成します。この関数は {{domxref("event.target")}} のチェックしてどの要素に対して呼び出されたのかを判別し、文書の {{domxref("Document.fullscreenElement", "fullscreenElement")}} の値と要素を比較して、同じノードであるかどうかを確認します。

+ +

これを isFullscreen の値に設定して adjustMyControls() という関数に渡し、これがウィンドウ内が全画面モードで表示されているときにアプリのユーザーインターフェイスが最適に表示されるように調整する関数になると想像してください。

+ +
function toggleFullscreen() {
+  let elem = document.querySelector("video");
+
+  elem.onfullscreenchange = handleFullscreenChange;
+  if (!document.fullscreenElement) {
+    elem.requestFullscreen().then({}).catch(err => {
+      alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
+    });
+  } else {
+    document.exitFullscreen();
+  }
+}
+
+function handleFullscreenChange(event) {
+  let elem = event.target;
+  let isFullscreen = document.fullscreenElement === elem;
+
+  adjustMyControls(isFullscreen);
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("Fullscreen", "#handler-document-onfullscreenchange", "onfullscreenchange")}}{{Spec2("HTML WHATWG")}}初回定義
+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + diff --git a/files/ja/conflicting/web/api/element/fullscreenerror_event/index.html b/files/ja/conflicting/web/api/element/fullscreenerror_event/index.html new file mode 100644 index 0000000000..95cbd0764b --- /dev/null +++ b/files/ja/conflicting/web/api/element/fullscreenerror_event/index.html @@ -0,0 +1,78 @@ +--- +title: Element.onfullscreenerror +slug: conflicting/Web/API/Element/fullscreenerror_event +tags: + - API + - Element + - Event Handler + - Full + - Full-screen API + - Property + - Reference + - fullscreen + - onfullscreenerror + - screen + - プロパティ + - 全画面モード +translation_of: Web/API/Element/onfullscreenerror +original_slug: Web/API/Element/onfullscreenerror +--- +
{{ApiRef("Fullscreen API")}}
+ +

{{domxref("Element")}} インターフェイスの onfullscreenchange プロパティは {{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントのイベントハンドラーで、要素が全画面モードへ移行するか、終了するときにエラーが発生したときに発生します。

+ +

構文

+ +
targetElement.onfullscreenerror = fullscreenErrorHandler;
+
+ +

+ +

{{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントのエラーハンドラーです。

+ +

+ +

この例は、ユーザーが主導するイベント ({{domxref("Element/click_event", "click")}} や {{domxref("Element/keypress_event", "keypress")}} イベントなど) のハンドラーの外から全画面モードへの切り替えを試みます。全画面モードへの意向は、ユーザー入力への応答の中からしか許可されていないため、これによってエラーが発生し、 {{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントをエラーハンドラーに配信します。

+ +
let elem = document.querySelector("video")}}
+
+elem.onfullscreenerror = function ( event ) {
+  displayWarning("Unable to switch into full-screen mode.");
+};
+
+//....
+
+elem.requestFullscreen();
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}{{Spec2("HTML WHATWG")}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.Element.onfullscreenerror")}}

+ +

関連情報

+ + diff --git a/files/ja/conflicting/web/api/window/gamepadconnected_event/index.html b/files/ja/conflicting/web/api/window/gamepadconnected_event/index.html new file mode 100644 index 0000000000..228ecd4cba --- /dev/null +++ b/files/ja/conflicting/web/api/window/gamepadconnected_event/index.html @@ -0,0 +1,66 @@ +--- +title: Window.ongamepadconnected +slug: conflicting/Web/API/Window/gamepadconnected_event +tags: + - API + - Event Handler + - Experimental + - Gamepad API + - Property + - Reference + - Window + - ongamepadconnected +translation_of: Web/API/Window/ongamepadconnected +original_slug: Web/API/Window/ongamepadconnected +--- +
+
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+
+ +
{{domxref("Window")}}  インターフェイスの ongamepadconnected プロパティは、ゲームパッドが接続されたとき ({{event('gamepadconnected')}}イベントが発生したとき) に実行されるイベントハンドラを表します。
+ +
 
+ +

イベントのオブジェクトの型は {{domxref("GamepadEvent")}} です。

+ +

構文

+ +
window.ongamepadconnected = function() { ... };
+
+ +

+ +
window.ongamepadconnected = function(event) {
+  // All buttons and axes values can be accessed through
+  event.gamepad;
+};
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}初版
+ +

ブラウザの互換性

+ + + +

{{Compat("api.Window.ongamepadconnected")}}

+ +

参照

+ + diff --git a/files/ja/conflicting/web/api/window/gamepaddisconnected_event/index.html b/files/ja/conflicting/web/api/window/gamepaddisconnected_event/index.html new file mode 100644 index 0000000000..d0a42860a0 --- /dev/null +++ b/files/ja/conflicting/web/api/window/gamepaddisconnected_event/index.html @@ -0,0 +1,61 @@ +--- +title: Window.ongamepaddisconnected +slug: conflicting/Web/API/Window/gamepaddisconnected_event +tags: + - API + - Event Handler + - Experimental + - Gamepad API + - Property + - Reference + - Window + - ongamepaddisconnected +translation_of: Web/API/Window/ongamepaddisconnected +original_slug: Web/API/Window/ongamepaddisconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

{{domxref("Window")}} インターフェースの ongamepaddisconnected プロパティはゲームパッドが切断した時 ({{event('gamepaddisconnected')}} イベントが発生したとき) に実行されるイベントハンドラーを表します。

+ +

イベントのオブジェクトの型は {{domxref("GamepadEvent")}} です。

+ +

構文

+ +
window.ongamepaddisconnected = function() { ... };
+
+ +

+ +
window.ongamepaddisconnected = function() {
+  // A gamepad has been disconnected
+};
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}初版
+ +

ブラウザの互換性

+ + + +

{{Compat("api.Window.ongamepaddisconnected")}}

+ +

参照

+ + diff --git a/files/ja/web/api/element/onfullscreenchange/index.html b/files/ja/web/api/element/onfullscreenchange/index.html deleted file mode 100644 index f58e332afb..0000000000 --- a/files/ja/web/api/element/onfullscreenchange/index.html +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: Element.onfullscreenchange -slug: Web/API/Element/onfullscreenchange -tags: - - API - - Element - - Event Handler - - Full - - Full-screen - - Fullscreen API - - Property - - Reference - - fullscreen - - onfullscreenchange - - screen - - イベントハンドラー - - プロパティ - - 全画面 - - 全画面モード -translation_of: Web/API/Element/onfullscreenchange ---- -
{{ApiRef("Fullscreen API")}}
- -

{{domxref("Element")}} インターフェイスの onfullscreenchange プロパティは、 {{domxref("Element/fullscreenchange_event", "fullscreenchange")}} イベントのイベントハンドラーで、要素が全画面モードへ移行するか、終了するときに発生します。

- -

構文

- -
targetDocument.onfullscreenchange = fullscreenChangeHandler;
-
- -

- -

{{event("fullscreenchange")}} イベントのイベントハンドラーで、要素が全画面モードへ移行または終了したことを示します。

- -

- -

この例では fullscreenchange イベントのハンドラーである handleFullscreenChange() を作成します。この関数は {{domxref("event.target")}} のチェックしてどの要素に対して呼び出されたのかを判別し、文書の {{domxref("Document.fullscreenElement", "fullscreenElement")}} の値と要素を比較して、同じノードであるかどうかを確認します。

- -

これを isFullscreen の値に設定して adjustMyControls() という関数に渡し、これがウィンドウ内が全画面モードで表示されているときにアプリのユーザーインターフェイスが最適に表示されるように調整する関数になると想像してください。

- -
function toggleFullscreen() {
-  let elem = document.querySelector("video");
-
-  elem.onfullscreenchange = handleFullscreenChange;
-  if (!document.fullscreenElement) {
-    elem.requestFullscreen().then({}).catch(err => {
-      alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
-    });
-  } else {
-    document.exitFullscreen();
-  }
-}
-
-function handleFullscreenChange(event) {
-  let elem = event.target;
-  let isFullscreen = document.fullscreenElement === elem;
-
-  adjustMyControls(isFullscreen);
-}
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("Fullscreen", "#handler-document-onfullscreenchange", "onfullscreenchange")}}{{Spec2("HTML WHATWG")}}初回定義
- -

ブラウザーの互換性

- -

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

- -

関連情報

- - diff --git a/files/ja/web/api/element/onfullscreenerror/index.html b/files/ja/web/api/element/onfullscreenerror/index.html deleted file mode 100644 index b1a08f41c9..0000000000 --- a/files/ja/web/api/element/onfullscreenerror/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Element.onfullscreenerror -slug: Web/API/Element/onfullscreenerror -tags: - - API - - Element - - Event Handler - - Full - - Full-screen API - - Property - - Reference - - fullscreen - - onfullscreenerror - - screen - - プロパティ - - 全画面モード -translation_of: Web/API/Element/onfullscreenerror ---- -
{{ApiRef("Fullscreen API")}}
- -

{{domxref("Element")}} インターフェイスの onfullscreenchange プロパティは {{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントのイベントハンドラーで、要素が全画面モードへ移行するか、終了するときにエラーが発生したときに発生します。

- -

構文

- -
targetElement.onfullscreenerror = fullscreenErrorHandler;
-
- -

- -

{{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントのエラーハンドラーです。

- -

- -

この例は、ユーザーが主導するイベント ({{domxref("Element/click_event", "click")}} や {{domxref("Element/keypress_event", "keypress")}} イベントなど) のハンドラーの外から全画面モードへの切り替えを試みます。全画面モードへの意向は、ユーザー入力への応答の中からしか許可されていないため、これによってエラーが発生し、 {{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントをエラーハンドラーに配信します。

- -
let elem = document.querySelector("video")}}
-
-elem.onfullscreenerror = function ( event ) {
-  displayWarning("Unable to switch into full-screen mode.");
-};
-
-//....
-
-elem.requestFullscreen();
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}{{Spec2("HTML WHATWG")}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.Element.onfullscreenerror")}}

- -

関連情報

- - diff --git a/files/ja/web/api/window/ongamepadconnected/index.html b/files/ja/web/api/window/ongamepadconnected/index.html deleted file mode 100644 index ce2246c3cd..0000000000 --- a/files/ja/web/api/window/ongamepadconnected/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Window.ongamepadconnected -slug: Web/API/Window/ongamepadconnected -tags: - - API - - Event Handler - - Experimental - - Gamepad API - - Property - - Reference - - Window - - ongamepadconnected -translation_of: Web/API/Window/ongamepadconnected ---- -
-
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
-
- -
{{domxref("Window")}}  インターフェイスの ongamepadconnected プロパティは、ゲームパッドが接続されたとき ({{event('gamepadconnected')}}イベントが発生したとき) に実行されるイベントハンドラを表します。
- -
 
- -

イベントのオブジェクトの型は {{domxref("GamepadEvent")}} です。

- -

構文

- -
window.ongamepadconnected = function() { ... };
-
- -

- -
window.ongamepadconnected = function(event) {
-  // All buttons and axes values can be accessed through
-  event.gamepad;
-};
- -

仕様

- - - - - - - - - - - - - - -
仕様状態コメント
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}初版
- -

ブラウザの互換性

- - - -

{{Compat("api.Window.ongamepadconnected")}}

- -

参照

- - diff --git a/files/ja/web/api/window/ongamepaddisconnected/index.html b/files/ja/web/api/window/ongamepaddisconnected/index.html deleted file mode 100644 index f9b33bb033..0000000000 --- a/files/ja/web/api/window/ongamepaddisconnected/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Window.ongamepaddisconnected -slug: Web/API/Window/ongamepaddisconnected -tags: - - API - - Event Handler - - Experimental - - Gamepad API - - Property - - Reference - - Window - - ongamepaddisconnected -translation_of: Web/API/Window/ongamepaddisconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

{{domxref("Window")}} インターフェースの ongamepaddisconnected プロパティはゲームパッドが切断した時 ({{event('gamepaddisconnected')}} イベントが発生したとき) に実行されるイベントハンドラーを表します。

- -

イベントのオブジェクトの型は {{domxref("GamepadEvent")}} です。

- -

構文

- -
window.ongamepaddisconnected = function() { ... };
-
- -

- -
window.ongamepaddisconnected = function() {
-  // A gamepad has been disconnected
-};
- -

仕様

- - - - - - - - - - - - - - -
仕様状態コメント
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}初版
- -

ブラウザの互換性

- - - -

{{Compat("api.Window.ongamepaddisconnected")}}

- -

参照

- - diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index e7eb0f6a6e..2f010dde80 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -379,6 +379,8 @@ /ru/docs/Web/API/WebRTC_API/связь /ru/docs/Web/API/WebRTC_API/Connectivity /ru/docs/Web/API/Window/crypto /ru/docs/Web/API/crypto_property /ru/docs/Web/API/Window/mozAnimationStartTime /ru/docs/Web/API/Animation/startTime +/ru/docs/Web/API/Window/ongamepadconnected /ru/docs/conflicting/Web/API/Window/gamepadconnected_event +/ru/docs/Web/API/Window/ongamepaddisconnected /ru/docs/conflicting/Web/API/Window/gamepaddisconnected_event /ru/docs/Web/API/Window/performance /ru/docs/Web/API/performance_property /ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding /ru/docs/Glossary/Base64 /ru/docs/Web/API/WindowBase64/btoa /ru/docs/Web/API/btoa diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index fd690347f2..a46230ec2c 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -11321,18 +11321,6 @@ "timur-gilauri" ] }, - "Web/API/Window/ongamepadconnected": { - "modified": "2020-11-17T12:43:15.635Z", - "contributors": [ - "venanen" - ] - }, - "Web/API/Window/ongamepaddisconnected": { - "modified": "2020-11-17T12:45:18.585Z", - "contributors": [ - "venanen" - ] - }, "Web/API/Window/onpaint": { "modified": "2019-03-23T22:08:47.903Z", "contributors": [ @@ -24241,6 +24229,18 @@ "akhabibullina" ] }, + "conflicting/Web/API/Window/gamepadconnected_event": { + "modified": "2020-11-17T12:43:15.635Z", + "contributors": [ + "venanen" + ] + }, + "conflicting/Web/API/Window/gamepaddisconnected_event": { + "modified": "2020-11-17T12:45:18.585Z", + "contributors": [ + "venanen" + ] + }, "conflicting/Web/API/Window/localStorage": { "modified": "2019-03-23T22:05:00.067Z", "contributors": [ diff --git a/files/ru/conflicting/web/api/window/gamepadconnected_event/index.html b/files/ru/conflicting/web/api/window/gamepadconnected_event/index.html new file mode 100644 index 0000000000..f6ff1a3474 --- /dev/null +++ b/files/ru/conflicting/web/api/window/gamepadconnected_event/index.html @@ -0,0 +1,40 @@ +--- +title: Window.ongamepadconnected +slug: conflicting/Web/API/Window/gamepadconnected_event +translation_of: Web/API/Window/ongamepadconnected +original_slug: Web/API/Window/ongamepadconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

Свойство ongamepadconnected интерфейса {{domxref("Window")}} представляет собой обработчик, который будет запущен при подключении геймпада (когда событие  {{event('gamepadconnected')}} запустится).

+ +

Тип объекта события - {{domxref("GamepadEvent")}}.

+ +

Синтаксис

+ +
window.ongamepadconnected = function() { ... };
+
+ +

Пример

+ +
window.ongamepadconnected = function(event) {
+  // All buttons and axes values can be accessed through
+  event.gamepad;
+};
+ +

Спецификация

+ +{{Specifications}} + +

Browser compatibility

+ + + +

{{Compat}}

+ +

Смотрите также

+ + diff --git a/files/ru/conflicting/web/api/window/gamepaddisconnected_event/index.html b/files/ru/conflicting/web/api/window/gamepaddisconnected_event/index.html new file mode 100644 index 0000000000..411e9eea24 --- /dev/null +++ b/files/ru/conflicting/web/api/window/gamepaddisconnected_event/index.html @@ -0,0 +1,39 @@ +--- +title: Window.ongamepaddisconnected +slug: conflicting/Web/API/Window/gamepaddisconnected_event +translation_of: Web/API/Window/ongamepaddisconnected +original_slug: Web/API/Window/ongamepaddisconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

Свойство ongamepaddisconnected интерфейса {{domxref("Window")}} представляет собой обработчик события, который будет вызван при отключении геймпада (когда сработает событие {{event('gamepaddisconnected')}}).

+ +

Тип объекта события {{domxref("GamepadEvent")}}.

+ +

Синтаксис

+ +
window.ongamepaddisconnected = function() { ... };
+
+ +

Пример

+ +
window.ongamepaddisconnected = function() {
+  // A gamepad has been disconnected
+};
+ +

Спецификация

+ +{{Specifications}} + +

Браузерная совместимость

+ + + +

{{Compat}}

+ +

Смотрите также

+ + diff --git a/files/ru/web/api/window/ongamepadconnected/index.html b/files/ru/web/api/window/ongamepadconnected/index.html deleted file mode 100644 index 758fed2d2d..0000000000 --- a/files/ru/web/api/window/ongamepadconnected/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Window.ongamepadconnected -slug: Web/API/Window/ongamepadconnected -translation_of: Web/API/Window/ongamepadconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

Свойство ongamepadconnected интерфейса {{domxref("Window")}} представляет собой обработчик, который будет запущен при подключении геймпада (когда событие  {{event('gamepadconnected')}} запустится).

- -

Тип объекта события - {{domxref("GamepadEvent")}}.

- -

Синтаксис

- -
window.ongamepadconnected = function() { ... };
-
- -

Пример

- -
window.ongamepadconnected = function(event) {
-  // All buttons and axes values can be accessed through
-  event.gamepad;
-};
- -

Спецификация

- -{{Specifications}} - -

Browser compatibility

- - - -

{{Compat}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/window/ongamepaddisconnected/index.html b/files/ru/web/api/window/ongamepaddisconnected/index.html deleted file mode 100644 index 26390e5430..0000000000 --- a/files/ru/web/api/window/ongamepaddisconnected/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Window.ongamepaddisconnected -slug: Web/API/Window/ongamepaddisconnected -translation_of: Web/API/Window/ongamepaddisconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

Свойство ongamepaddisconnected интерфейса {{domxref("Window")}} представляет собой обработчик события, который будет вызван при отключении геймпада (когда сработает событие {{event('gamepaddisconnected')}}).

- -

Тип объекта события {{domxref("GamepadEvent")}}.

- -

Синтаксис

- -
window.ongamepaddisconnected = function() { ... };
-
- -

Пример

- -
window.ongamepaddisconnected = function() {
-  // A gamepad has been disconnected
-};
- -

Спецификация

- -{{Specifications}} - -

Браузерная совместимость

- - - -

{{Compat}}

- -

Смотрите также

- - diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 84dfe0d381..b1214b6ed1 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1315,6 +1315,8 @@ /zh-CN/docs/Web/API/Element/onbeforescriptexecute /zh-CN/docs/Web/API/Document/onbeforescriptexecute /zh-CN/docs/Web/API/Element/oncopy /zh-CN/docs/Web/API/HTMLElement/oncopy /zh-CN/docs/Web/API/Element/oncut /zh-CN/docs/Web/API/HTMLElement/oncut +/zh-CN/docs/Web/API/Element/onfullscreenchange /zh-CN/docs/Web/API/Element/fullscreenchange_event +/zh-CN/docs/Web/API/Element/onfullscreenerror /zh-CN/docs/Web/API/Element/fullscreenerror_event /zh-CN/docs/Web/API/Element/onpaste /zh-CN/docs/Web/API/HTMLElement/onpaste /zh-CN/docs/Web/API/Element/removeAttributre /zh-CN/docs/Web/API/Element/removeAttribute /zh-CN/docs/Web/API/Event/CustomEvent /zh-CN/docs/Web/API/CustomEvent @@ -1590,6 +1592,8 @@ /zh-CN/docs/Web/API/Window/minimize /zh-CN/docs/conflicting/Web/API/Window /zh-CN/docs/Web/API/Window/mozAnimationStartTIme /zh-CN/docs/Web/API/Animation/startTime /zh-CN/docs/Web/API/Window/onbeforeunload /zh-CN/docs/Web/API/WindowEventHandlers/onbeforeunload +/zh-CN/docs/Web/API/Window/ongamepadconnected /zh-CN/docs/conflicting/Web/API/Window/gamepadconnected_event +/zh-CN/docs/Web/API/Window/ongamepaddisconnected /zh-CN/docs/Web/API/Window/gamepaddisconnected_event /zh-CN/docs/Web/API/Window/onhashchange /zh-CN/docs/Web/API/WindowEventHandlers/onhashchange /zh-CN/docs/Web/API/Window/onpopstate /zh-CN/docs/Web/API/WindowEventHandlers/onpopstate /zh-CN/docs/Web/API/Window/onresize /zh-CN/docs/Web/API/GlobalEventHandlers/onresize diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 4589deb197..6de70e3d52 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -12143,6 +12143,19 @@ "liuhe" ] }, + "Web/API/Element/fullscreenchange_event": { + "modified": "2019-03-18T21:19:43.587Z", + "contributors": [ + "Wyatt" + ] + }, + "Web/API/Element/fullscreenerror_event": { + "modified": "2020-10-15T22:21:46.027Z", + "contributors": [ + "kjyzly", + "LinChengDior" + ] + }, "Web/API/Element/getAttribute": { "modified": "2019-04-29T04:23:55.908Z", "contributors": [ @@ -12432,19 +12445,6 @@ "ziyunfei" ] }, - "Web/API/Element/onfullscreenchange": { - "modified": "2019-03-18T21:19:43.587Z", - "contributors": [ - "Wyatt" - ] - }, - "Web/API/Element/onfullscreenerror": { - "modified": "2020-10-15T22:21:46.027Z", - "contributors": [ - "kjyzly", - "LinChengDior" - ] - }, "Web/API/Element/openOrClosedShadowRoot": { "modified": "2020-10-15T22:35:17.746Z", "contributors": [ @@ -22901,6 +22901,12 @@ "libin2866" ] }, + "Web/API/Window/gamepaddisconnected_event": { + "modified": "2020-10-15T22:23:08.406Z", + "contributors": [ + "AWhiteMouse" + ] + }, "Web/API/Window/getComputedStyle": { "modified": "2020-10-15T21:29:18.864Z", "contributors": [ @@ -23160,18 +23166,6 @@ "PengyaoZhang" ] }, - "Web/API/Window/ongamepadconnected": { - "modified": "2020-10-15T22:22:28.465Z", - "contributors": [ - "VoidRain" - ] - }, - "Web/API/Window/ongamepaddisconnected": { - "modified": "2020-10-15T22:23:08.406Z", - "contributors": [ - "AWhiteMouse" - ] - }, "Web/API/Window/online_event": { "modified": "2019-04-18T11:22:47.220Z", "contributors": [ @@ -47272,6 +47266,12 @@ "ziyunfei" ] }, + "conflicting/Web/API/Window/gamepadconnected_event": { + "modified": "2020-10-15T22:22:28.465Z", + "contributors": [ + "VoidRain" + ] + }, "conflicting/Web/API/Window/localStorage": { "modified": "2019-03-23T22:25:01.381Z", "contributors": [ diff --git a/files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html b/files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html new file mode 100644 index 0000000000..8ec4daf1f5 --- /dev/null +++ b/files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html @@ -0,0 +1,65 @@ +--- +title: Window.ongamepadconnected +slug: conflicting/Web/API/Window/gamepadconnected_event +tags: + - API + - Event Handler + - Experimental + - Gamepad API + - Property + - Reference + - Window + - gamepadconnected + - ongamepadconnected + - 手柄 + - 游戏 +translation_of: Web/API/Window/ongamepadconnected +original_slug: Web/API/Window/ongamepadconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

{{domxref("Window")}} 接口的 ongamepadconnected 属性是一个事件处理程序,它将在游戏手柄连接时运行 (即当 {{event('gamepadconnected')}} 事件触发时)。

+ +

此方法响应的对象类型是 {{domxref("GamepadEvent")}}.

+ +

语法

+ +
window.ongamepadconnected = function() { ... };
+
+ +

示例

+ +
window.ongamepadconnected = function(event) {
+  // 手柄上所有的可用按键和手柄控制元件上各轴向数值都能在此获取
+  event.gamepad;
+};
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}Initial definition
+ +

浏览器兼容性

+ + + +

{{Compat("api.Window.ongamepadconnected")}}

+ +

相关知识

+ + diff --git a/files/zh-cn/web/api/element/fullscreenchange_event/index.html b/files/zh-cn/web/api/element/fullscreenchange_event/index.html new file mode 100644 index 0000000000..7da05dd65b --- /dev/null +++ b/files/zh-cn/web/api/element/fullscreenchange_event/index.html @@ -0,0 +1,79 @@ +--- +title: Element.onfullscreenchange +slug: Web/API/Element/fullscreenchange_event +translation_of: Web/API/Element/onfullscreenchange +original_slug: Web/API/Element/onfullscreenchange +--- +
元素接口的 onfullscreenchange 属性是在元素过渡到或过渡到全屏模式时触发的全屏更改事件的事件处理程序。
+ +

语法

+ +
targetDocument.onfullscreenchange = fullscreenChangeHandler;
+
+ +

+ +

当事件处理程序处于 fullscreenchange 模式的时候, 表明游戏元素被改变了或者是退出了全屏模式

+ +

Example

+ +

本示例建立一个fullscreenchange 处理程序, handleFullscreenChange ()。此函数通过检查 event.target 的值来确定调用它的元素, 然后将文档的fullscreenElement 值与元素进行比较, 以查看它们是否为同一节点。

+ +

这给了我们一个值, 即 isFullscreen, 我们将其传递到一个名为 adjustMyControls() 的函数, 我们想象它是一个函数, 可以对应用的用户界面进行调整, 以便在全屏模式下而不是在窗口。

+ +
function toggleFullscreen() {
+  let elem = document.querySelector("video");
+
+  elem.onfullscreenchange = handleFullscreenChange;
+  if (!document.fullscreenElement) {
+    elem.requestFullscreen().then({}).catch(err => {
+      alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
+    });
+  } else {
+    document.exitFullscreen();
+  }
+}
+
+function handleFullscreenChange(event) {
+  let elem = event.target;
+  let isFullscreen = document.fullscreenElement === elem;
+
+  adjustMyControls(isFullscreen);
+}
+
+ +

 

+ +

程序规范

+ + + + + + + + + + + + + + +
规范表达式程序状态解释
Fullscreen API
+ The definition of 'Document.fullscreenElement' in that specification.
Living Standard初始化定义
+ +

浏览器适配

+ +

请切换至英文版本查看浏览器适配统计表

+ +

此页上的兼容性表是由结构化数据生成的。如果您想提供数据, 请查看 https://github.com/mdn/browser-compat-data 并向我们发送 pull request

+ +

其他

+ + diff --git a/files/zh-cn/web/api/element/fullscreenerror_event/index.html b/files/zh-cn/web/api/element/fullscreenerror_event/index.html new file mode 100644 index 0000000000..502df3c680 --- /dev/null +++ b/files/zh-cn/web/api/element/fullscreenerror_event/index.html @@ -0,0 +1,65 @@ +--- +title: Element.onfullscreenerror +slug: Web/API/Element/fullscreenerror_event +translation_of: Web/API/Element/onfullscreenerror +original_slug: Web/API/Element/onfullscreenerror +--- +
{{ApiRef("Fullscreen API")}}
+ +

{{domxref("Element")}} 接口的 onfullscreenerror 属性是在{{domxref("Element")}} 过渡到或退出全屏模式发生错误后处理事件{{event("fullscreenerror")}}的事件处理程序。

+ +

语法

+ +
targetElement.onfullscreenerror = fullscreenErrorHandler;
+
+ +

+ +

一个处理事件{{event("fullscreenerror")}}的事件处理程序.

+ +

示例

+ +

本示例尝试不从用户发起的事件(如点击事件{{event("click")}}或键盘事件{{event("keypress")}})处理程序来触发全屏,由于全屏模式只允许由用户主动输入触发,因此该操作会发生错误,从而导致{{domxref("Element")}}会触发{{event("fullscreenerror")}}事件传递给错误处理程序

+ +
let elem = document.querySelector("video")}}
+
+elem.onfullscreenerror = function ( event ) {
+  displayWarning("Unable to switch into full-screen mode.");
+};
+
+//....
+
+elem.requestFullscreen();
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}{{Spec2("HTML WHATWG")}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("api.Element.onfullscreenerror")}}

+ +

其他

+ + diff --git a/files/zh-cn/web/api/element/onfullscreenchange/index.html b/files/zh-cn/web/api/element/onfullscreenchange/index.html deleted file mode 100644 index 2a2b2416cf..0000000000 --- a/files/zh-cn/web/api/element/onfullscreenchange/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Element.onfullscreenchange -slug: Web/API/Element/onfullscreenchange -translation_of: Web/API/Element/onfullscreenchange ---- -
元素接口的 onfullscreenchange 属性是在元素过渡到或过渡到全屏模式时触发的全屏更改事件的事件处理程序。
- -

语法

- -
targetDocument.onfullscreenchange = fullscreenChangeHandler;
-
- -

- -

当事件处理程序处于 fullscreenchange 模式的时候, 表明游戏元素被改变了或者是退出了全屏模式

- -

Example

- -

本示例建立一个fullscreenchange 处理程序, handleFullscreenChange ()。此函数通过检查 event.target 的值来确定调用它的元素, 然后将文档的fullscreenElement 值与元素进行比较, 以查看它们是否为同一节点。

- -

这给了我们一个值, 即 isFullscreen, 我们将其传递到一个名为 adjustMyControls() 的函数, 我们想象它是一个函数, 可以对应用的用户界面进行调整, 以便在全屏模式下而不是在窗口。

- -
function toggleFullscreen() {
-  let elem = document.querySelector("video");
-
-  elem.onfullscreenchange = handleFullscreenChange;
-  if (!document.fullscreenElement) {
-    elem.requestFullscreen().then({}).catch(err => {
-      alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
-    });
-  } else {
-    document.exitFullscreen();
-  }
-}
-
-function handleFullscreenChange(event) {
-  let elem = event.target;
-  let isFullscreen = document.fullscreenElement === elem;
-
-  adjustMyControls(isFullscreen);
-}
-
- -

 

- -

程序规范

- - - - - - - - - - - - - - -
规范表达式程序状态解释
Fullscreen API
- The definition of 'Document.fullscreenElement' in that specification.
Living Standard初始化定义
- -

浏览器适配

- -

请切换至英文版本查看浏览器适配统计表

- -

此页上的兼容性表是由结构化数据生成的。如果您想提供数据, 请查看 https://github.com/mdn/browser-compat-data 并向我们发送 pull request

- -

其他

- - diff --git a/files/zh-cn/web/api/element/onfullscreenerror/index.html b/files/zh-cn/web/api/element/onfullscreenerror/index.html deleted file mode 100644 index de9e5353c4..0000000000 --- a/files/zh-cn/web/api/element/onfullscreenerror/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Element.onfullscreenerror -slug: Web/API/Element/onfullscreenerror -translation_of: Web/API/Element/onfullscreenerror ---- -
{{ApiRef("Fullscreen API")}}
- -

{{domxref("Element")}} 接口的 onfullscreenerror 属性是在{{domxref("Element")}} 过渡到或退出全屏模式发生错误后处理事件{{event("fullscreenerror")}}的事件处理程序。

- -

语法

- -
targetElement.onfullscreenerror = fullscreenErrorHandler;
-
- -

- -

一个处理事件{{event("fullscreenerror")}}的事件处理程序.

- -

示例

- -

本示例尝试不从用户发起的事件(如点击事件{{event("click")}}或键盘事件{{event("keypress")}})处理程序来触发全屏,由于全屏模式只允许由用户主动输入触发,因此该操作会发生错误,从而导致{{domxref("Element")}}会触发{{event("fullscreenerror")}}事件传递给错误处理程序

- -
let elem = document.querySelector("video")}}
-
-elem.onfullscreenerror = function ( event ) {
-  displayWarning("Unable to switch into full-screen mode.");
-};
-
-//....
-
-elem.requestFullscreen();
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}{{Spec2("HTML WHATWG")}}Initial definition.
- -

浏览器兼容性

- - - -

{{Compat("api.Element.onfullscreenerror")}}

- -

其他

- - diff --git a/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html b/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html new file mode 100644 index 0000000000..48ef7f7e79 --- /dev/null +++ b/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html @@ -0,0 +1,52 @@ +--- +title: Window.ongamepaddisconnected +slug: Web/API/Window/gamepaddisconnected_event +translation_of: Web/API/Window/ongamepaddisconnected +original_slug: Web/API/Window/ongamepaddisconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

The ongamepaddisconnected property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).

+ +

The event object is of type {{domxref("GamepadEvent")}}.

+ +

解析

+ +
window.ongamepaddisconnected = function() { ... };
+
+ +

示例

+ +
window.ongamepaddisconnected = function() {
+  // A gamepad has been disconnected
+};
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("api.Window.ongamepaddisconnected")}}

+ +

See also

+ + diff --git a/files/zh-cn/web/api/window/ongamepadconnected/index.html b/files/zh-cn/web/api/window/ongamepadconnected/index.html deleted file mode 100644 index 809fd1f1c7..0000000000 --- a/files/zh-cn/web/api/window/ongamepadconnected/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Window.ongamepadconnected -slug: Web/API/Window/ongamepadconnected -tags: - - API - - Event Handler - - Experimental - - Gamepad API - - Property - - Reference - - Window - - gamepadconnected - - ongamepadconnected - - 手柄 - - 游戏 -translation_of: Web/API/Window/ongamepadconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

{{domxref("Window")}} 接口的 ongamepadconnected 属性是一个事件处理程序,它将在游戏手柄连接时运行 (即当 {{event('gamepadconnected')}} 事件触发时)。

- -

此方法响应的对象类型是 {{domxref("GamepadEvent")}}.

- -

语法

- -
window.ongamepadconnected = function() { ... };
-
- -

示例

- -
window.ongamepadconnected = function(event) {
-  // 手柄上所有的可用按键和手柄控制元件上各轴向数值都能在此获取
-  event.gamepad;
-};
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}Initial definition
- -

浏览器兼容性

- - - -

{{Compat("api.Window.ongamepadconnected")}}

- -

相关知识

- - diff --git a/files/zh-cn/web/api/window/ongamepaddisconnected/index.html b/files/zh-cn/web/api/window/ongamepaddisconnected/index.html deleted file mode 100644 index 7712dd6066..0000000000 --- a/files/zh-cn/web/api/window/ongamepaddisconnected/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Window.ongamepaddisconnected -slug: Web/API/Window/ongamepaddisconnected -translation_of: Web/API/Window/ongamepaddisconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

The ongamepaddisconnected property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).

- -

The event object is of type {{domxref("GamepadEvent")}}.

- -

解析

- -
window.ongamepaddisconnected = function() { ... };
-
- -

示例

- -
window.ongamepaddisconnected = function() {
-  // A gamepad has been disconnected
-};
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}Initial definition
- -

Browser compatibility

- - - -

{{Compat("api.Window.ongamepaddisconnected")}}

- -

See also

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