zoukankan      html  css  js  c++  java
  • PC页面全屏显示以及退出全屏显示

    //点击,进入全屏
    $('#btn4').click(()=>{
          let el = document.documentElement;
          let rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; 
          if(typeof rfs != 'undefined' && rfs){
            rfs.call(el)
          }else if(typeof window.ActiveXObject != 'undefined'){
            let wscript = new ActiveXObject('WScript.Shell');
            if(wscript != null){
              wscript.SendKeys('{F11}')
            }
          }
        })
    
    //点击,退出全屏
        $('#btn5').click(()=>{
          let exitFn = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullScreen || document.webkitCancelFullScreen;
          if(exitFn){
            exitFn.call(document);
          }else if(typeof window.ActiveXObject != 'undefined'){
            let wscript = new ActiveXObject('WScript.Shell');
            if(wscript != null){
              wscript.SendKeys('{F11}');
            }
          }
        })
  • 相关阅读:
    CSpinButtonCtrl控件的使用
    JS基础语法
    JS
    层级,hover
    Html&Css
    定位
    制作静态网页
    查看trunk端口
    配置vlan trunk
    js日期的写法,获取girdviw的行数、提示信息、验证数量信息
  • 原文地址:https://www.cnblogs.com/libo0125ok/p/15438067.html
Copyright © 2011-2022 走看看