-1
Hello, I was wondering if someone could explain me this piece of code, it activates the Full Screen mode of the browsers, however I wanted to understand and also wanted to know if "Document.fullscreenElement" is something native or something created by the person who did.
function toggleFullScreen() {
if (!document.fullscreenElement && !document.mozFullScreenElement
&& !document.webkitFullscreenElement
&& !document.msFullscreenElement) {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.msRequestFullscreen) {
document.documentElement.msRequestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement
.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}
http://answall.com/questions/1855/existe-alguma-maneira-de-ativar-a-tela-cheia-do-navegador-com-javascript
– Andre Figueiredo