Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Methods
 resizeTo Method
resizeTo Method

Sets the size of the window to the specified width and height values.

Syntax

object.resizeTo(iWidth, iHeight)

Parameters

iWidth Required. Integer that specifies the width of the window in pixels. The value can be either positive or negative.
iHeight Required. Integer that specifies the height of the window in pixels. The value can be either positive or negative.

Return Value

No return value.

Remarks

This method is not valid with windows created using the showModalDialog or showModelessDialog methods. In order to move or resize a dialog window created with these methods, change the dialogHeight, dialogWidth, dialogTop, and dialogLeft properties.

If the page (that contains this script) is hosted within an IFRAME, the IFRAME will move relative to the upper-left corner of the content area.

Windows XP Service Pack 2 (SP2) or later. Windows that are located in the Internet Zone are subject to Window_Restrictions and will be forced to stay on screen. This applies to moveTo, moveBy, resizeTo, and resizeBy methods.

Note  When operating in high-dpi mode, pixel values are scaled up accordingly. See Adjusting Scale for Higher DPI Screens for additional information.

Windows Internet Explorer 7. This method is only effective when a single tab is open or when tabbed browsing is disabled. If multiple tabs are open, this method is blocked. For information regarding tab interaction from a script, see Tabbed Browsing for Developers.

Internet Explorer 7. This method is blocked if called by a foreign domain within a sub-frame (FRAME/IFRAME).

Standards Information

There is no public standard that applies to this method.

Applies To

window, Window Constructor

See Also

resizeBy
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Why does popup window size differ from previous size?      John Sudds ... painnick   |   Edit   |   Show History

한국만루 써두 되나 모르겠는데
Don’t know if this could be written in Korean.

risize 후 팝업창 사이즈가 전에 사이즈랑 틀려지는 이유는?
Why does popup window size change from previous size after risize(?) ?

I suspect that when you close a popup window, IE saves the window size as its default size for new windows. Unless you specify window dimensions in your call to window.open, IE will use the previously saved window size.

NOTE: Korean is fine! However, this is not the right place to ask questions. Please refer to the MSDN Forums.

http://forums.microsoft.com/MSDN/default.aspx

Another answer.

width/height parameters on window.open() method means content-size.(exclude title-bar and status-bar etc...)

but width/height parameters on window.resizeTo() method includes title-bar and status-bar etc...

Tags What's this?: dhtml (x) Add a tag
Flag as ContentBug
Some restriction on timing      OxG   |   Edit   |   Show History
If you call the Window.ResizeTo method during a Window_Onload, it fails with an "Access Denied" message.
Subsequent calls (either programmatic, or by hitting F5 to refresh window) work as expected.
Very wierd; don't yet have a workaround...
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker