我正在開發一個GWT web應用程序,並且對於特定需求,我需要在加載時全屏顯示我唯一託管的html頁面。 這是我們在任何網頁上按下F11的幫助完成的。我需要在我的GWT應用程序中完全相同的功能。需要在頁面加載時以全屏方式顯示託管html頁面
我已經嘗試了Javascript的這一沒有奏效的一瞥。
<script language="JavaScript1.2">
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
</script>
難道有可能嗎?
這不能在我的GWT應用程序的情況下完成,因爲我只在託管的html頁面上使用。 我需要的功能與在瀏覽器上按F11時相同,並且它變爲全屏。 – 2012-03-13 17:49:47
大多數瀏覽器故意阻止您想要的行爲。他們讓用戶選擇瀏覽器大小。您可以期望的最好的方式是從您的託管頁面打開的瀏覽器。 – Deanna 2012-03-13 18:31:24