📜  全屏模式 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:20.606000             🧑  作者: Mango

代码示例1
async function FullScreenOn() {
  document.getElementById("fullscreenElement")
    .requestFullscreen()
    .then((response) => {
       console.log("full screen on");
    })
    .catch((error) => {
       console.log("Error: ", error);
    });
}

async function FullScreenOff() {
  document.exitFullscreen()
    .then((response) => {
       console.log("full screen off");
    })
    .catch((error) => {
       console.log("Error: ", error);
    });
}