js全屏

FullScreen() {
      let element = document.getElementById('id')
      let requestMethod =
        element.requestFullScreen ||
        element.webkitRequestFullScreen ||
        element.mozRequestFullScreen ||
        element.msRequestFullScreen
      if (requestMethod) {
        requestMethod.call(element)
      } else if (typeof window.ActiveXObject !== 'undefined') {
        let wscript = new ActiveXObject('WScript.Shell')
        if (wscript !== null) {
          wscript.SendKeys('{F11}')
        }
      }
      var h = document.documentElement.clientHeight
      element.style.height = h + 'px'
      element.style.marginLeft = '0'
    },

 

你可能感兴趣的:(js)