Question

In Firefox you can enter the following into the awesome bar and hit enter:

javascript:self.resizeTo(1024,768);

How do you do the same thing in IE?

Was it helpful?

Solution

javascript:resizeTo(1024,768);
vbscript:resizeto(1024,768)

Will work in IE7, But consider using something like

javascript:moveTo(0,0);resizeTo(1024,768);

because IE7 doesn't allow the window to "resize" beyond the screen borders. If you work on a 1024,768 desktop, this is what happens...

  • Firefox: 1024x768 Window, going behind the taskbar. If you drop the moveTo part, the top left corner of the window won't change position.(You still get a 1024x768 window)
  • IE7: As close as possible to the requested size without obscuring the taskbar or allowing any part of the window to lie beyond the screen borders.
  • safari: As close as possible to the requested size without obscuring the taskbar or allowing any part of the window to lie beyond the screen borders, but you can ommit the moveTo part. Safari will move the top left corner of the window for you.
  • Opera: Nothing happens.
  • Chrome: Nothing happens.

OTHER TIPS

Maybe not directly related if you were looking for only a JavaScript solution but you can use the free Windows utility Sizer to automatically resize any (browser) window to a predefined size like 800x600, 1024,768, etc.

enter image description here

Your code works in IE, you just need to "Allow blocked Content" in the Security Toolbar

http://i38.tinypic.com/20uahkl.jpg

Try:

javascript:resizeTo(1024,768);

This works in IE7 at least.

It works in IE6, but I think IE7 added some security around this?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top