zoukankan      html  css  js  c++  java
  • js全屏与退出全屏

    function Fullscreen() {
        var elem = document.documentElement;
        // 判断浏览器设备类型
        if (elem.webkitRequestFullScreen) {  // 兼容谷歌
            elem.webkitRequestFullScreen();
        } else if (elem.mozRequestFullScreen) {  // 兼容火狐
            elem.mozRequestFullScreen();
        } else if (elem.requestFullscreen) {
            elem.requestFullscreen();
        } else if (element.msRequestFullscreen) {  // 兼容IE
            elem.msRequestFullscreen();
        } else {
            //浏览器不支持全屏API或已被禁用
        }
    }
    
    // 退出全屏在谷歌浏览器无效
    function ExitFullscreen() {
        if (document.exitFullscreen) {
            document.exitFullscreen();
        } else if (document.msExitFullscreen) {
            document.msExitFullscreen();
        } else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
        } else if (document.webkitExitFullscreen) {
            document.webkitExitFullscreen();
        }
    }
    365个夜晚,我希望做到两天更一篇博客。加油,小白!
  • 相关阅读:
    数据分析之Anaconda安装
    算法作业三
    算法作业二
    html
    qingdao
    hdu 123
    排序作业
    hdu 5614
    hdu 456
    poj 3140 树形去边差异最小
  • 原文地址:https://www.cnblogs.com/qq2806933146xiaobai/p/15140188.html
Copyright © 2011-2022 走看看