[removed] Automatically maximize browser window and switch to full screen mode?

前端 未结 5 1057
渐次进展
渐次进展 2021-01-22 10:55

I am working on a Flash app that is 900x700 pixels. When viewed in misc. browsers at 1024x768, the browser chrome causes robs too much of the vertical space and the app appears

相关标签:
5条回答
  • 2021-01-22 11:28

    You can use JavaScript to open a new window (using window.open) and control the window that is opened (no address bar, etc). You can also control the size of the window (you can't maximize it, but you can get the users screen size, and set the window that same size).

    0 讨论(0)
  • 2021-01-22 11:37

    The window size can be altered by using:

    window.moveTo(0, 0);
    window.resizeTo(screen.availWidth, screen.availHeight);
    
    0 讨论(0)
  • 2021-01-22 11:45

    To answer the question in the comment you made to your own post. Yes. You can have a button whose click handler does this

    stage.displayState = StageDisplayState.FULL_SCREEN;
    
    0 讨论(0)
  • 2021-01-22 11:49

    Chrome 15, Firefox 10, and Safari 5.1 now provide APIs to programmatically trigger fullscreen mode. Fullscreen mode triggered this way provide events to detect fullscreen changes and CSS pseudo-classes for styling fullscreen elements. These APIs may present you with a more acceptable solution for those browsers.

    See this hacks.mozilla.org blog post for details.

    0 讨论(0)
  • 2021-01-22 11:54

    There is no way to maximize the browser window to full screen with JavaScript. While this is unfortunate for your genuine requirement, it is considered a security restriction.

    Sources:

    • Stack Overflow - To view the silverlight app in fullscreen mode(F11)
    • SitePoint Forums - Trigger F11 using javascript
    • Webmaster World - F11 Fullscreen using Javascript
    0 讨论(0)
提交回复
热议问题