기능 0 – fullscreen

1877 단어



    
    fullscreen


    
let content = document.getElementById('content'); let openBtn = document.getElementById('btn'); let closeBtn = document.getElementById('closeBtn'); openBtn.onclick = function(){ fullScreen(content); } closeBtn.onclick = function(){ closeFullScreen(); } // function fullScreen(elem){   let docElm = document.documentElement;   if (docElm.requestFullscreen) {     // console.log(1) docElm.requestFullscreen();   } else if (docElm.mozRequestFullScreen) {     // console.log(2) docElm.mozRequestFullScreen(); // firefox   } else if (docElm.webkitRequestFullScreen) {     // console.log('webkit ') // chrome、360、QQ、   docElm.webkitRequestFullScreen();   } else if (docElm.msRequestFullscreen) {       // console.log(4)       elem.msRequestFullscreen(); // IE   }      } // function closeFullScreen(){   if (document.exitFullscreen) {     document.exitFullscreen();   }else if (document.mozCancelFullScreen) {     document.mozCancelFullScreen();   }else if (document.webkitCancelFullScreen) {     document.webkitCancelFullScreen();   }else if (document.msExitFullscreen) {     document.msExitFullscreen();   }      }   

좋은 웹페이지 즐겨찾기