We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

document.mozFullScreenElement

概述

返回当前文档中正在以全屏模式显示的Element节点,如果没有使用全屏模式,则返回null.

语法

var element = document.mozFullScreenElement;

示例

function isVideoInFullsreen() {
  if (document.mozFullScreenElement && document.mozFullScreenElement.nodeName == 'VIDEO') {
    console.log('您的视频正在以全屏模式显示');
  }
}

辅助

查看使用"全屏模式"页面了解详情.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 9.0 (9.0) ? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 9.0 (9.0) ? ? ?

规范

该方法提案已经进入相关规范草案 http://dvcs.w3.org/hg/fullscrezh-CN/raw-file/tip/Overview.html#dom-document-fullscreenelement

相关链接

文档标签和贡献者

此页面的贡献者: teoli, jsx, ziyunfei
最后编辑者: jsx,