zoukankan      html  css  js  c++  java
  • 浏览器全屏效果

    1.全屏监听事件
    const isFullscreen =
          document.fullscreenElement ||
          document.mozFullScreenElement ||
          document.webkitFullscreenElement ||
          document.fullScreen ||
          document.mozFullScreen ||
          document.webkitIsFullScreen;
        isFullscreen = !!isFullscreen;
        let that = this;
        document.addEventListener("fullscreenchange", () => {
          that.isFull = !that.isFull;
        });
        document.addEventListener("mozfullscreenchange", () => {
          that.isFull = !that.isFull;
        });
        document.addEventListener("webkitfullscreenchange", () => {
          that.isFull = !that.isFull;
        });
        document.addEventListener("msfullscreenchange", () => {
          that.isFull = !that.isFull;
        });
    
    2.全屏点击事件
    fullScreenEvent() {
          let el = document.documentElement;
          if (this.isFull) {
            if (document.exitFullscreen) {
              document.exitFullscreen();
            } else if (document.mozCancelFullScreen) {
              document.mozCancelFullScreen();
            } else if (document.webkitCancelFullScreen) {
              document.webkitCancelFullScreen();
            } else if (document.msExitFullscreen) {
              document.msExitFullscreen();
            }
          } else {
            if (el.requestFullscreen) {
              el.requestFullscreen();
            } else if (el.mozRequestFullScreen) {
              el.mozRequestFullScreen();
            } else if (el.webkitRequestFullScreen) {
              el.webkitRequestFullScreen();
            } else if (el.msRequestFullscreen) {
              el.msRequestFullscreen();
            }
          }
        }
    

      

  • 相关阅读:
    Oracle登录报错-ORA-00119
    Oracle11g配置监听
    Python Turtle模块的简单应用
    Turtle模块基本方法和使用(画布)
    python+selenium自动化禅道登录测试
    Xlrd模块读取Excel文件数据
    Selenium原理
    Axure中的登陆界面和动画轮播
    SQL Server创建用户并分配权限
    EF实体框架创建方法
  • 原文地址:https://www.cnblogs.com/cx709452428/p/13358009.html
Copyright © 2011-2022 走看看