码迷,mamicode.com
首页 > Web开发 > 详细

fullScreen.html

时间:2015-11-10 19:03:16      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:

<!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>

 

fullScreen.html

标签:

原文地址:http://www.cnblogs.com/cynthia-wuqian/p/4953767.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!