fullScreen.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>index</title>
</head>
<body>
    <input type="button" value="全屏显示" onclick="fullScreen()">
<script>

    function fullScreen() {
        var el = document.documentElement;
        var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;

        if (typeof rfs !== "undefined" && rfs) {
            rfs.call(el);
        } else if (typeof window.ActiveXObject !== "undefined") {
            // for Internet Explorer
            var wscript = new ActiveXObject("WScript.Shell");
                wscript.SendKeys("{F11}");
        }
    }    
    
</script>
</body>
</html>

 

posted @ 2015-11-10 17:35  Cynthia娆墨旧染  阅读(152)  评论(0编辑  收藏  举报