Switch window between normal and full-screen mode

后端 未结 2 1510
囚心锁ツ
囚心锁ツ 2020-12-21 02:30

Is it possible to force window to switch between normal and full-screen mode by JavaScript (no jQuery)..?

<
相关标签:
2条回答
  • 2020-12-21 03:07

    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.

    0 讨论(0)
  • 2020-12-21 03:31

    You could try the experimental FullScreen API.

    • Using full-screen mode on MDN
    • W3c Fullscreen Living Spec
    • Browser Support

    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.

    0 讨论(0)
提交回复
热议问题