blob: 45a1879029a607533c0c7635e3a8e0094d919135 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
---
title: document.mozFullScreenElement
slug: Web/API/Document/fullscreenElement
translation_of: Web/API/DocumentOrShadowRoot/fullscreenElement
original_slug: Web/API/DocumentOrShadowRoot/fullscreenElement
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<p>返回当前文档中正在以全屏模式显示的{{ domxref("Element") }}节点,如果没有使用全屏模式,则返回<code>null</code>.</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<pre class="eval"><em>var element</em> = <em>document</em>.mozFullScreenElement;
</pre>
<h3 id="Example" name="Example">示例</h3>
<pre class="eval">function isVideoInFullsreen() {
if (document.mozFullScreenElement && document.mozFullScreenElement.nodeName == 'VIDEO') {
console.log('您的视频正在以全屏模式显示');
}
}</pre>
<h3 id="辅助">辅助</h3>
<p>查看<a href="/zh-CN/docs/DOM/Using_full-screen_mode" title="zh-CN/docs/DOM/Using full-screen mode">使用"全屏模式"</a>页面了解详情.</p>
<h3 id="Specification" name="Specification">浏览器兼容性</h3>
{{Compat("api.Document.fullscreenElement")}}
|