📜  javascript 全屏 - Javascript 代码示例

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

代码示例1
//creating a button and linking it to bClicked()
document.onload=()=>{
  let b = documentbody.createElement("button");
  b.onclick = bClicked;
}

function bClicked(){
  //yourID is the id of element that you want to fullscreen 
  document.getElementByID("yourID").requestFullscreen();
}

//to exit fullscreen
document.exitFullscreen();