English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
fullscreenEnabledA read-only property indicating whether full-screen mode is available.
If full-screen mode can be used, the fullscreenEnabled property returns true; otherwise, it returns false.
Note:This method requires a specific prefix to be used in different browsers (please refer to the browser compatibility below).
Useelement .requestFullscreen()method to view elements in full-screen mode.
Useelement .exitFullscreen()Method to cancel full-screen mode.
document.fullscreenEnabled
function openFullscreen() { if (document.fullscreenEnabled) { videoElement.requestFullScreen(); } else { console.log('Your browser cannot use fullscreen right now'); } }Test to see‹/›
The numbers in the table specify the first browser version that fully supports the fullscreenEnabled property:
Property | |||||
fullscreenEnabled | 45 -webkit- | 47 -moz- | 15 -webkit- | 5.1 -webkit- | 12-ms- |
Return Value: | A boolean value, if it can be called throughelement .requestFullscreen()When the document and its elements are in full-screen modetrue. If full-screen mode cannot be used, this value isfalse. |
---|
DOM ElementsexitFullscreen()Methods
DOM ElementsrequestFullscreen()Methods