使用Javascript:自动最大化浏览器窗口,切换到全屏模式? [英] Javascript: Automatically maximize browser window and switch to full screen mode?

查看:606
本文介绍了使用Javascript:自动最大化浏览器窗口,切换到全屏模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Flash应用程序是900x700像素。当杂项查看。在1024x768的浏览器,chrome浏览器的原因剥夺了太多的垂直空间和应用程序出现在同一个垂直滚动条的窗口。不能接受的。

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 in a window with a vertical scrollbar. Unacceptable.

该Flash应用程序将通过电子邮件发送给观众的链接推出。

The flash app will be launched via a link emailed to the viewers.

我想避免调整的Flash应用程序,并想知道如果有一种方法可以做到通过JavaScript以下,没有涉及点击:

I'd like to avoid resizing the flash app and am wondering if there's a way to do the following via javascript, with no clicks involved:


  1. 最大化当前浏览器窗口

  2. 删除当前窗口的地址栏和标签/浏览器切换到全屏视图(折合pressing F11)。

另一种方法是垂直调整的Flash应用程序相匹配的浏览器画布的高度,以避免滚动。这可能会导致应用程序变得不可读,所以不是最好的方法在我的情况。

An alternative would be to resize the flash app vertically to match the browser canvas height to avoid scrolling. This may cause the app to become unreadable, so not the best approach in my case.

感谢您!

更新:看来,浏览器调整大小并自动切换到全屏幕将不起作用,都不会对闪存应用自动调整。什么是那么最好的方法?而且,一些用户可能会使用浏览器工具栏或打开一个小的浏览器窗口。

UPDATE: Seems that browser resizing and autoswitch to full screen won't work and neither will the flash app auto resize. What is the best approach then? And, some users may have browsers with toolbars or open a small browser window.

我唯一的想法是使用JavaScript和小的浏览器窗口,以preS F11手动显示一条消息给用户。观众是执行时,有些甚至可能不知道的F11是什么意思...

The only idea I have is to use javascript and display a message to users with small browser windows to pres F11 manually. The audience is executes and some may not even know what an F11 means...

推荐答案

要回答你自己的岗位上做出了评论的问题。是。你可以有一个按钮,其单击处理程序做到这一点。

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;

这篇关于使用Javascript:自动最大化浏览器窗口,切换到全屏模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆