标签:board onload load methods cancel oar stand cli keyboard
<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>
标签:board onload load methods cancel oar stand cli keyboard
原文地址:http://www.cnblogs.com/liwp/p/6894067.html