Answers for "Fullscreen API"

0

Fullscreen API

document.addEventListener("keypress", function(e) {
  if (e.keyCode === 13) {
    toggleFullScreen();
  }
}, false);
Posted by: Guest on August-06-2021
0

Fullscreen API

function toggleFullScreen() {
  if (!document.fullscreenElement) {
      document.documentElement.requestFullscreen();
  } else {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    }
  }
}
Posted by: Guest on August-06-2021

Browse Popular Code Answers by Language