diff options
Diffstat (limited to 'files/zh-cn/web/api/document/fullscreenenabled')
-rw-r--r-- | files/zh-cn/web/api/document/fullscreenenabled/index.html | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/fullscreenenabled/index.html b/files/zh-cn/web/api/document/fullscreenenabled/index.html new file mode 100644 index 0000000000..248797541a --- /dev/null +++ b/files/zh-cn/web/api/document/fullscreenenabled/index.html @@ -0,0 +1,82 @@ +--- +title: document.mozFullScreenEnabled +slug: Web/API/Document/mozFullScreenEnabled +translation_of: Web/API/Document/fullscreenEnabled +--- +<p>{{ ApiRef() }}</p> +<h3 id="Summary" name="Summary">概述</h3> +<p>返回一个布尔值,表明浏览器是否支持全屏模式. 全屏模式只在那些不包含窗口化的插件的页面中可用.对于一个{{ HTMLElement("iframe") }}元素中的页面,则它必需拥有{{ HTMLAttrXRef("mozallowfullscreen", "iframe") }}属性.</p> +<h3 id="Syntax" name="Syntax">语法</h3> +<pre class="eval"><em>var isFullScreenAvailable</em> = <em>document</em>.mozFullScreenEnabled; +</pre> +<p>如果当前文档可以进入全屏模式,则<code>isFullScreenAvailable</code>为<code>true</code></p> +<h3 id="Example" name="Example">例子</h3> +<pre class="eval">function requestFullScreen() { + if (document.mozFullScreenEnabled) { + videoElement.requestFullScreen(); + } else { + console.log('你的浏览器不支持全屏模式!'); + } +} +</pre> +<h3 id="备注">备注</h3> +<p>进入页面<a href="/zh-cn/DOM/Using_full-screen_mode" title="zh-cn/DOM/Using full-screen mode">使用全屏模式</a>查看详情和示例.</p> +<h3 id="Specification" name="Specification">浏览器兼容性</h3> +<p>{{ CompatibilityTable() }}</p> +<div id="compat-desktop"> + <table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatGeckoDesktop("10.0") }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<div id="compat-mobile"> + <table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatGeckoMobile("10.0") }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<h3 id="Specification" name="Specification">规范</h3> +<p>该方法在规范草案 <a class="external" href="http://dvcs.w3.org/hg/fullscrezh-cn/raw-file/tip/Overview.html#dom-document-fullscreenenabled" title="http://dvcs.w3.org/hg/fullscrezh-cn/raw-file/tip/Overview.html#dom-document-fullscreenenabled">http://dvcs.w3.org/hg/fullscrezh-cn/raw-file/tip/Overview.html#dom-document-fullscreenenabled</a> 中被提出.</p> +<h3 id="相关链接">相关链接</h3> +<ul> + <li><a href="/zh-cn/DOM/Using_full-screen_mode" title="zh-cn/DOM/Using full-screen mode">Using full-screen mode</a></li> + <li>{{ domxref("element.mozRequestFullScreen()") }}</li> + <li>{{ domxref("document.mozCancelFullScreen()") }}</li> + <li>{{ domxref("document.mozFullScreen") }}</li> + <li>{{ domxref("document.mozFullScreenElement") }}</li> + <li>{{ cssxref(":-moz-full-screen") }}</li> + <li>{{ HTMLAttrXRef("mozallowfullscreen", "iframe") }}</li> +</ul> +<p>{{ languages( { "en": "en/DOM/document.mozFullScreenEnabled" } ) }}</p> |