JS浏览器全屏

JS浏览器全屏
//全屏
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");
        if (wscript != null) {
            wscript.SendKeys("{F11}");
        }
    }

}

//退出全屏
function exitFullScreen() {
    var el = document;
    var rfs = el.webkitCancelFullScreen || el.mozCancelFullScreen || el.cancelFullScreen || el.exitFullscreen;

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

}
View Code

JS浏览器全屏,布布扣,bubuko.com

JS浏览器全屏

上一篇:C# Socket 入门2(转)


下一篇:Windows清理助手最新版3.1发布及下载地址