toggleFullScreen() && document.body.style.display = 'none';
if (toggleFullScreen()) {console.log('document.body.style'))
if (toggleFullScreen() === true) {console.log('document.body.style'))
console.log(toggleFullScreen())
let toggleFullScreen = () => {
const { requestFullscreen, mozRequestFullScreen, webkitRequestFullscreen } = document.documentElement;
const { fullscreenElement, mozFullScreenElement, webkitFullscreenElement,
cancelFullScreen, mozCancelFullScreen,webkitCancelFullScreen
} = document;
if (!fullscreenElement && // alternative standard method
!mozFullScreenElement && !webkitFullscreenElement) { // current working methods
if (requestFullscreen) {
requestFullscreen();
} else if (mozRequestFullScreen) {
mozRequestFullScreen();
} else if (webkitRequestFullscreen) {
webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (cancelFullScreen) {
cancelFullScreen();
} else if (mozCancelFullScreen) {
mozCancelFullScreen();
} else if (webkitCancelFullScreen) {
webkitCancelFullScreen();
}
}
}
let toggleFullScreen = () => {
const { requestFullscreen, mozRequestFullScreen, webkitRequestFullscreen } = document.documentElement;
const { fullscreenElement, mozFullScreenElement, webkitFullscreenElement,
cancelFullScreen, mozCancelFullScreen,webkitCancelFullScreen
} = document;
if (!fullscreenElement && !mozFullScreenElement && !webkitFullscreenElement) { // current working methods
requestFullscreen && requestFullscreen() || mozRequestFullScreen &&mozRequestFullScreen();
|| webkitRequestFullscreen && webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
} else
cancelFullScreen && cancelFullScreen() || mozCancelFullScreen && mozCancelFullScreen()
|| webkitCancelFullScreen &&webkitCancelFullScreen();
}
}