开发者

Javascript for full screen

is there a javascript script tha开发者_StackOverflow社区t auto fullscreen mode the browser? example if you visit my site, the browser will auto fullscreen upon load..


Please, don't do this. You shouldn't resize the browser, that's the user's choice to make.

If I have my browser at a certain size, and your site is one of 20 tabs, why should the other 20 be resized?

If you're using window.open() to open a new window and want to specify a size, that's fine, but don't resize the browser. Most browsers actively block this, for a reason.


I looked into this once and like Nick said browsers do not allow you to control setting fullscreen for security reasons e.g. think malicious website recreating the toolbar to trick users. The closest you can get to it is explaining to the user in a ribbon or popup the first time they visit, how to get to fullscreen and letting them make the decision. Then the trick is check for the keypress on f11 assuming that's how you had the user do it.

The only place I wish it was allowed for the site to go fullscreen is webapps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜