aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/element/fullscreenerror_event
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2022-02-13 00:57:20 +0000
committerMDN <actions@users.noreply.github.com>2022-02-13 00:57:20 +0000
commita617ec8afec43949849163167daaf51a60d2b298 (patch)
treedee1a1dc953762fc075d0517e05278142e7faf9a /files/zh-cn/web/api/element/fullscreenerror_event
parent45dd46e6b17e45bcb3655c53eb921119359336f7 (diff)
downloadtranslated-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/element/fullscreenerror_event')
-rw-r--r--files/zh-cn/web/api/element/fullscreenerror_event/index.html65
1 files changed, 65 insertions, 0 deletions
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
+---
+<div>{{ApiRef("Fullscreen API")}}</div>
+
+<p><span class="seoSummary">{{domxref("Element")}} 接口的 <code><strong>onfullscreenerror</strong></code> 属性是在{{domxref("Element")}} 过渡到或退出全屏模式发生错误后处理事件{{event("fullscreenerror")}}的事件处理程序。</span></p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><var>targetElement</var>.onfullscreenerror = <var>fullscreenErrorHandler</var>;
+</pre>
+
+<h3 id="值">值</h3>
+
+<p>一个处理事件{{event("fullscreenerror")}}的事件处理程序.</p>
+
+<h2 id="示例">示例</h2>
+
+<p>本示例尝试不从用户发起的事件(如点击事件{{event("click")}}或键盘事件{{event("keypress")}})处理程序来触发全屏,由于全屏模式只允许由用户主动输入触发,因此该操作会发生错误,从而导致<span class="seoSummary">{{domxref("Element")}}会</span>触发{{event("fullscreenerror")}}事件传递给错误处理程序</p>
+
+<pre class="brush: js">let elem = document.querySelector("video")}}
+
+elem.onfullscreenerror = function ( event ) {
+ displayWarning("Unable to switch into full-screen mode.");
+};
+
+//....
+
+elem.requestFullscreen();</pre>
+
+<h2 id="规范">规范</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("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.Element.onfullscreenerror")}}</p>
+
+<h2 id="其他">其他</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/Fullscreen_API">Fullscreen API </a></li>
+ <li><a href="/en-US/docs/Web/API/Fullscreen_API/Guide">Guide to the Fullscreen API</a></li>
+ <li>{{event("fullscreenerror")}}</li>
+ <li>{{domxref("Element.onfullscreenchange")}}</li>
+ <li>{{domxref("Document.onfullscreenerror")}}</li>
+</ul>