1 //进入全屏 2 function requestFullScreen() { 3 var de = document.documentElement; 4 if (de.requestFullscreen) { 5 de.requestFullscreen(); 6 } else if (de.mozRequestFullScreen) { 7 de.mozRequestFullScreen(); 8 } else if (de.webkitRequestFullScreen) { 9 de.webkitRequestFullScreen(); 10 } 11 } 12 13 //退出全屏 14 function exitFullscreen() { 15 var de = document; 16 if (de.exitFullscreen) { 17 de.exitFullscreen(); 18 } else if (de.mozCancelFullScreen) { 19 de.mozCancelFullScreen(); 20 } else if (de.webkitCancelFullScreen) { 21 de.webkitCancelFullScreen(); 22 } 23 }