zoukankan      html  css  js  c++  java
  • html页面全屏化显示

    <html>
    <head>
    <script>
    // toggle full screen
    function toggleFullScreen() {
    if (!document.fullscreenElement && // alternative standard method
    !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods
    if (document.documentElement.requestFullscreen) {
    document.documentElement.requestFullscreen();
    } else if (document.documentElement.mozRequestFullScreen) {
    document.documentElement.mozRequestFullScreen();
    } else if (document.documentElement.webkitRequestFullscreen) {
    document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    }
    } else {
    if (document.cancelFullScreen) {
    document.cancelFullScreen();
    } else if (document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
    } else if (document.webkitCancelFullScreen) {
    document.webkitCancelFullScreen();
    }
    }
    }
    window.onload = function () {
    toggleFullScreen();
    }
    </script>
    </head>
    <body>
    <div onclick='toggleFullScreen();'>全屏</div>
    </body>
    </html>

  • 相关阅读:
    Exercise02_09
    Exercise02_05
    Exercise02_01
    Exercise02_03
    Exercise02_07
    web.xml配置详解
    面对不成功的人生
    请不以结婚为目的的恋爱吧
    年轻人能为世界做点什么
    不作就不会活
  • 原文地址:https://www.cnblogs.com/liwp/p/6894067.html
Copyright © 2011-2022 走看看