How to make the window full screen with Javascript (stretching all over the screen)

后端 未结 19 1835
天涯浪人
天涯浪人 2020-11-21 22:13

How can I make a visitor\'s browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?

19条回答
  •  不思量自难忘°
    2020-11-21 22:41

    Luckily for unsuspecting web users this cannot be done with just javascript. You would need to write browser specific plugins, if they didn't already exist, and then somehow get people to download them. The closest you can get is a maximized window with no tool or navigation bars but users will still be able to see the url.

    window.open('http://www.web-page.com', 'title' , 'type=fullWindow, fullscreen, scrollbars=yes');">

    This is generally considered bad practice though as it removes a lot of browser functionality from the user.

提交回复
热议问题