使用javascript退出IE 10或更低版本的全屏模式

时间:2014-08-29 12:18:32

标签: javascript internet-explorer fullscreen

我无法使用javascript退出IE的全屏模式。

我使用的退出全屏的代码是:

 docElement.msCancelFullScreen();

我也试过

 docElement.exitFullscreen();

我在网上搜索很多,但没有什么对我有用..请帮助我..

3 个答案:

答案 0 :(得分:3)

你不能,IE10及以下don't support the FullScreen API用户可以轻松退出,但没有IE API这样做。如果有一个较旧的IE特定API,他们可能会提到它here


我会注意到,退出全屏模式的ms-prefixed功能是msExitFullscreen,而不是msCancelFullScreen

答案 1 :(得分:1)

你可以试试这个:

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

答案 2 :(得分:0)

您使用的全屏API是IE11特定的。它不适用于IE10或更低版本。 http://msdn.microsoft.com/en-us/library/ie/dn265028(v=vs.85).aspx

参见Internet Explorer full screen mode? 解决方法。

相关问题