如何在Internet Explorer中获取和设置窗口弹出的高度和宽度

时间:2009-10-08 13:04:17

标签: javascript

如何使用JavaScript在 Internet Explorer 中获取和设置窗口弹出窗口的高度和宽度

在Firefox中,我可以使用window的outerHeight,outerWidth属性设置高度和宽度。

感谢。

2 个答案:

答案 0 :(得分:5)

如果是现有窗口,您可以使用window.resizeToMSDN link)设置尺寸:

window.resizeTo(640, 480)

或者,您可以使用window.open方法(MSDN link)指定创建窗口时的大小:

window.open ("http://stackoverflow.com",
"mywindow","location=1,status=1,scrollbars=1,
width=640,height=480"); 

答案 1 :(得分:0)

window.open('something.html','new_win','width=320,height=240');

另请参阅:http://google.com/search?q=popup+window+height+width+ie

相关问题