javascript 浏览器全屏全屏

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 浏览器全屏全屏相关的知识,希望对你有一定的参考价值。

    fullScreenFun: function() {
      let self = this;
      var fullscreenEnabled =
        document.fullscreenEnabled ||
        document.mozFullScreenEnabled ||
        document.webkitFullscreenEnabled ||
        document.msFullscreenEnabled;
      if (fullscreenEnabled) {
        let de = document.documentElement;
        if (!this.fullScreen) {
          this.fullScreen = true
          if (de.requestFullscreen) {
            de.requestFullscreen();
          } else if (de.mozRequestFullScreen) {
            de.mozRequestFullScreen();
          } else if (de.webkitRequestFullScreen) {
            de.webkitRequestFullScreen();
          }

        } else {
          this.fullScreen = false
          if (document.exitFullscreen) {
            document.exitFullscreen();
          } else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
          } else if (document.webkitCancelFullScreen) {
            document.webkitCancelFullScreen();
          }
        }
      } else {
        self.fullScreenInfo = "浏览器当前不能全屏";
      }
    

以上是关于javascript 浏览器全屏全屏的主要内容,如果未能解决你的问题,请参考以下文章

h5 video切换到横屏全屏

ZFPlayer iOS16 系统横屏全屏问题处理

ZFPlayer iOS16 系统横屏全屏问题处理

跳出小程序 video组件 卡顿黑屏全屏等坑

C# WinForm 实现全屏效果

电脑怎么全屏截图