Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

我們的志工尚未將此文章翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!

The Document.fullscreenEnabled read-only property returns a Boolean that reports whether or not full-screen mode is available. Full screen mode is available only for a page that has no windowed plug-ins in any of its documents, and if all <iframe> elements which contain the document have their allowfullscreen attribute set.

Although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.

Syntax

var isFullscreenAvailable = document.fullscreenEnabled;

On return, isFullscreenAvailable is true if the document can be put into full-screen mode.

Example

function requestFullScreen() {
  if (document.fullscreenEnabled) {
    videoElement.requestFullScreen();
  } else {
    console.log('Your browser cannot use fullscreen right now');
  }
}

Specifications

Specification Status Comment
Fullscreen API
The definition of 'Document.fullscreenEnabled' in that specification.
Living Standard Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 10.0 (10.0) as mozFullScreenEnabled
47.0 (47.0) (behind full-screen-api.unprefix.enabled
? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 10.0 (10.0)as mozFullScreenEnabled
47.0 (47.0) (behind full-screen-api.unprefix.enabled
? ? ?

See also

文件標籤與貢獻者

 此頁面的貢獻者: teoli, MHasan, cvrebert, kscarfone, Sheppy, fscholz, ziyunfei, ernestd, cpearce
 最近更新: teoli,