JS

HOW TO TOGGLE FULLSCREEN MODE IN JAVASCRIPT

TOGGLE FULLSCREEN IN JAVASCRIPT

FULL SCREEN - ENTIRE PAGE document.documentElement.requestFullscreen();   FULL SCREEN - SINGLE SECTION document.getElementById('ID').requestFullscreen();   EXIT FULL SCREEN document.exitFullscreen();

FULLSCREEN EVENTS

FULL SCREEN MODE TOGGLED document.addEventListener( "fullscreenchange", function(){   if (document.fullscreenElement===null)   { FULLSCREEN DISENGAGED }   else { FULLSCREEN ENGAGED } });   FULL SCREEN MODE ERROR document.addEventListener("fullscreenerror", function(){ DO SOMETHING });