简体   繁体   中英

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 )..?

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+). A brief history and usage examples here. Note that IE10 will allegedly not support the API.

You could try the experimental 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. Used this as a fallback option in a recent webapp I worked on, and the feedback was satisfactory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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