简体   繁体   English

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

[英]How to get and set window popup height and width in Internet Explorer

How to get and set window popup height and width in Internet Explorer using JavaScript 如何使用JavaScript在Internet Explorer中获取和设置窗口弹出高度和宽度

In Firefox I am able to set the height and width using outerHeight , outerWidth property of window. 在Firefox中,我可以使用window的outerHeight,outerWidth属性设置高度和宽度。

Thanks. 谢谢。

If it's an existing window, you can set the size using window.resizeTo ( MSDN link ): 如果它是现有窗口,您可以使用window.resizeToMSDN链接 )设置大小:

window.resizeTo(640, 480)

Or, you can specify the size when the window's being created using the window.open method ( MSDN link ): 或者,您可以使用window.open方法( MSDN链接 )指定创建窗口时的大小:

window.open ("http://stackoverflow.com",
"mywindow","location=1,status=1,scrollbars=1,
width=640,height=480"); 
window.open('something.html','new_win','width=320,height=240');

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM