Skip to content

Instantly share code, notes, and snippets.

@robnyman
Last active March 9, 2018 19:51
Show Gist options
  • Save robnyman/1705516 to your computer and use it in GitHub Desktop.
Save robnyman/1705516 to your computer and use it in GitHub Desktop.
Fullscreen API, fullscreenchange
document.addEventListener("fullscreenchange", function () {
fullscreenState.innerHTML = (document.fullscreen)? "" : "not ";
}, false);
document.addEventListener("mozfullscreenchange", function () {
fullscreenState.innerHTML = (document.mozFullScreen)? "" : "not ";
}, false);
document.addEventListener("webkitfullscreenchange", function () {
fullscreenState.innerHTML = (document.webkitIsFullScreen)? "" : "not ";
}, false);
document.addEventListener("msfullscreenchange", function () {
fullscreenState.innerHTML = (document.msFullscreenElement)? "" : "not ";
}, false);
@jared-cxz
Copy link

Line 13, the event name "msfullscreenchange" is not working in IE11. I used "MSFullscreenChange" instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment