全屏无法在IE中运行 [英] Fullscreen not working in IE

查看:78
本文介绍了全屏无法在IE中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已启动并运行滑块模块,但是Internet Explorer 11没有响应全屏按钮. Firefox和Chrome可以正常工作.我在堆栈上找到了此代码,但仍然没有区别.有什么想法吗?

So I have my slider module up and running but Internet Explorer 11 is not responding to the fullscreen button. Firefox and Chrome are working just fine. I found this code on Stack but still no difference. Any thoughts?

function toggleFullScreen() {
  if (!document.fullscreenElement &&    // alternative standard method
      !document.mozFullScreenElement && !document.webkitFullscreenElement) {  // current working methods
    if (document.documentElement.requestFullscreen) {
      document.documentElement.requestFullscreen();
    } else if (document.documentElement.mozRequestFullScreen) {
      document.documentElement.mozRequestFullScreen();
    } else if (document.documentElement.webkitRequestFullscreen) {
      document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    } else if (elem.msRequestFullscreen) {
            elem.msRequestFullscreen();
    }


  } else {
    if (document.cancelFullScreen) {
      document.cancelFullScreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.webkitCancelFullScreen) {
      document.webkitCancelFullScreen();
    } else if (document.msExitFullscreen) {
            document.msExitFullscreen();
        }
  }
}

 </script>

很抱歉,是否已回答此问题.我没有找到解决方案.

Sorry if this question has been answered. I haven't found the solution.

推荐答案

根据此网站的全屏API IE不支持.似乎也没有任何信息可以支持IE11.

According to this site the fullscreen API is not supported in IE. There seem to be no information on whether this is something that will be supported by IE11 either.

根据MDN的全屏文章,对于大多数浏览器来说,该技术仍处于试验阶段.

According to MDN's article on fullscreen it seems that this technique is still be very much experimental for most browsers.

您也可以尝试

Internet Explorer全屏模式?

将窗口设置为全屏(REAL全屏; F11功能)通过javascript

<script type="text/javascript">
    function max() {
        var wscript = new ActiveXObject("Wscript.shell");
        wscript.SendKeys("{F11}");
    }
</script>

如果您真的想在Internet Explorer中全屏显示...,请尝试在jquery中将滑块的宽度和高度设置为100%.

if you really want to have the full screen in internet explorer.... Try giving the slider wiidth and height 100% in jquery.

这篇关于全屏无法在IE中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆