HTML
<div id="mmm"> fullscreen 整個頁面或某個區塊變成全螢幕的形式, 呼叫 全螢幕 elem.requestFullscreen() 離開 全螢幕 document.exitFullscreen <script> function Fullscreen() { if (!window.screenTop && !window.screenY) { if ( mmm.requestFullscreen) { mmm.requestFullscreen(); } else if ( mmm.msRequestFullscreen) { mmm.msRequestFullscreen(); } else if ( mmm.mozRequestFullScreen) { mmm.mozRequestFullScreen(); } else if ( mmm.webkitRequestFullscreen) { mmm.webkitRequestFullscreen(); } B6.innerHTML ="exitFullscreen" ; return; } if ( document.exitFullscreen) { document.exitFullscreen(); } else if ( document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if ( document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if ( document.msExitFullscreen) { document.msExitFullscreen(); } B6.innerHTML ="fullscreen" } </script> 判斷現在是否全螢幕 if (!window.screenTop && !window.screenY) {....} css 全螢幕 設定 背景顏色 #mmm:-webkit-full-screen {background-color: cornsilk;} #mmm:-moz-full-screen {background-color: cornsilk;} #mmm:-ms-fullscreen {background-color: cornsilk;} #mmm:fullscreen {background-color: cornsilk;}
沒有留言:
張貼留言