The Document.exitFullscreen()
is a method that takes the document out of full-screen mode; this is used to reverse the effects of a call to make an element in the document full-screen using its Element.requestFullscreen()
method.
document.exitFullscreen();
// Click toggle fullscreen mode document.onclick = function (event) { if (document.fullscreenElement) { document.exitFullscreen() } else { document.documentElement.requestFullscreen() } };
Specification | Status | Comment |
---|---|---|
Fullscreen API The definition of 'Document.exitFullscreen()' in that specification. | Living Standard | Initial definition |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support |
(Yes)-webkit 45 (unprefixed) |
9.0 (9.0) as mozCancelFullScreen [1]47.0 (47.0)[1] (behind full-screen-api.unprefix.enabled
| ? | ? | ? |
Feature | Android Webkit | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support |
(Yes)-webkit 45 (unprefixed) |
(Yes)-webkit 45 (unprefixed) | 9.0 (9.0) as mozCancelFullScreen [1]47.0 (47.0)[1] (behind full-screen-api.unprefix.enabled
| ? | ? | ? |
[1] The full-screen mode "stack" which allows you to cancel full screen mode for one element, restoring a previous element to full-screen mode automatically, was implemented in Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8).
Element.requestFullscreen()
Document.exitFullscreen()
Document.fullscreen
Document.fullscreenElement
:fullscreen
allowfullscreen
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/document/exitFullscreen