头图
Today I saw a very interesting API, you can use js to operate the browser to enter the full screen state.

requestFullscreen

 <button id="fullscreen-button">Enter Fullscreen</button>
 document.querySelector('#fullscreen-button').addEventListener("click", function(e) {
  toggleFullScreen();
}, false);

function toggleFullScreen() {
  if (!document.fullscreenElement) {
      document.documentElement.requestFullscreen();
  } else {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    }
  }
}

online experience


来了老弟
508 声望31 粉丝

纸上得来终觉浅,绝知此事要躬行