2011-10-17 33 views
0

因此,在低於7的Firefox版本中,此腳本正在工作(它將瀏覽器窗口最大化爲最大訪問者監視器)。現在在FF 7 +中,它似乎不起作用。如果你能發現它爲什麼不起作用,或者如果你能給我類似的東西,我會非常感謝!這裏是我的代碼:Javascript或jQuery Autoresize腳本

<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> 
+0

「不工作」是什麼意思?你有錯誤嗎? –

+0

@ZachRattner nah,它根本無所作爲...... – Moozy

回答

1

fine manual

的window.outerHeight屬性爲只讀。

這同樣適用於window.outerWidth。有resizeToresizeBy但瀏覽器不一定會關注你的卑微請求。

瀏覽器窗口的大小是用戶的選擇,並調整其窗口大小有點粗魯,所以許多瀏覽器不會讓你這樣做。