简体   繁体   English

在正常模式和全屏模式之间切换窗口

[英]Switch window between normal and full-screen mode

Is it possible to force window to switch between normal and full-screen mode by JavaScript ( no jQuery )..? 是否可以强制窗口通过JavaScript( 没有jQuery )在正常模式和全屏模式之间切换 ..?

I know how to open a new window in full-screen, but that is not what I need. 我知道如何在全屏幕上打开一个新窗口,但这不是我需要的。

There's now a proper fullscreen API (first proposed by Mozilla and later released as a W3C proposal ) has been implemented by Webkit (Safari 5.1+/Chrome 15+) and Firefox (10+). 现在有一个适当的全屏API由Mozilla首次提出 ,后来作为W3C提议发布)已由Webkit(Safari 5.1 + / Chrome 15+)和Firefox(10+)实现。 A brief history and usage examples here. 这里简要介绍历史和用法示例。 Note that IE10 will allegedly not support the API. 请注意,IE10据称支持API。

You could try the experimental FullScreen API . 您可以尝试实验性的FullScreen API

If you are not satisfied with the browser support, there is one more option: display a message to the user about how F11 switches to Fullscreen mode. 如果您对浏览器支持不满意,还有一个选项:向用户显示有关F11如何切换到全屏模式的消息。 Used this as a fallback option in a recent webapp I worked on, and the feedback was satisfactory. 在我最近使用的webapp中使用它作为后备选项,反馈令人满意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM