-
Notifications
You must be signed in to change notification settings - Fork 2
/
fullscreen.js
17 lines (17 loc) · 902 Bytes
/
fullscreen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var fullscreenButton = document.getElementById('fullscreen');
if (fullscreenButton && (document.exitFullscreen||document.webkitExitFullscreen||document.webkitExitFullScreen||document.mozCancelFullScreen||document.msExitFullscreen)) {
fullscreenButton.onclick = function() {
var d = document;
if (d.fullscreenElement||d.webkitFullscreenElement||d.webkitFullScreenElement||d.mozFullScreenElement||d.msFullscreenElement) {
(d.exitFullscreen||d.webkitExitFullscreen||d.webkitExitFullScreen||d.mozCancelFullScreen||d.msExitFullscreen).call(d);
} else {
var e = document.body;
(e.requestFullscreen||e.webkitRequestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen).call(e);
}
}
if (window.navigator.standalone === true) {
fullscreenButton.style.opacity = '0';
}
} else if (fullscreenButton) {
fullscreenButton.style.opacity = '0';
}