diff options
author | MDN <actions@users.noreply.github.com> | 2022-02-13 00:57:20 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2022-02-13 00:57:20 +0000 |
commit | a617ec8afec43949849163167daaf51a60d2b298 (patch) | |
tree | dee1a1dc953762fc075d0517e05278142e7faf9a /files/zh-cn/web/api/window/gamepaddisconnected_event/index.html | |
parent | 45dd46e6b17e45bcb3655c53eb921119359336f7 (diff) | |
download | translated-content-a617ec8afec43949849163167daaf51a60d2b298.tar.gz translated-content-a617ec8afec43949849163167daaf51a60d2b298.tar.bz2 translated-content-a617ec8afec43949849163167daaf51a60d2b298.zip |
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/web/api/window/gamepaddisconnected_event/index.html')
-rw-r--r-- | files/zh-cn/web/api/window/gamepaddisconnected_event/index.html | 52 |
1 files changed, 52 insertions, 0 deletions
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 +--- +<div>{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}</div> + +<p>The <strong><code>ongamepaddisconnected</code></strong> property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).</p> + +<p>The event object is of type {{domxref("GamepadEvent")}}.</p> + +<h2 id="解析">解析</h2> + +<pre class="syntaxbox">window.ongamepaddisconnected = function() { ... }; +</pre> + +<h2 id="示例">示例</h2> + +<pre class="brush:js; line-numbers language-js"><code class="language-js">window<span class="punctuation token">.</span><span class="punctuation token">on</span><span class="string token">gamepaddisconnected =</span> <span class="keyword token">function</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> + <span class="comment token">// A gamepad has been disconnected</span> +<span class="punctuation token">}</span><span class="punctuation token">;</span></code></pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}</td> + <td>{{Spec2('Gamepad')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Window.ongamepaddisconnected")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a class="external text" href="https://hacks.mozilla.org/2013/12/the-gamepad-api/" rel="nofollow">The Gamepad API</a> by Ted Mielczarek and Robert Nyman</li> + <li><a href="http://luser.github.io/gamepadtest/">Simple API demo page</a> (<a href="https://github.com/luser/gamepadtest">source</a>)</li> +</ul> |