Forum Discussion
Full Screen
I have a button that trigger this JS:
if ((document.fullScreenElement && document.fullScreenElement !== null) ||
(!document.mozFullScreen && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
- HarshadJogle2635 years agoCommunity Member
Thanks, Daniel. I need the course to start in full screen as soon it is launched, not on a click. Is there a way to achieve this?
- mikhacavin3 years agoCommunity Member
hey daniel, thankyou so much for your script. it work well, while i use in desktop , tablet and android phone!
love from Indonesia.