Can't figure this out for the life of me. Google is no help either. I'm sure its super easy.
+10
A:
It's not that easy. For one thing, this is generally something you should not do. Firefox for example has an option to disable Javascript from resizing the browser. It's considered anything from a security risk to just a plain annoyanace.
Resizing the browser puts you in the same bucket as poker and "She's waiting for you!" sites. Just don't do it.
If you need a window of a specific size, open one of that size with the options to window.open()
.
Having read all that if you still must do it, use window.resizeTo()
.
cletus
2009-06-25 00:02:40
+1 for "She's waiting for you!"
karim79
2009-06-25 00:04:43
Great answer...glad you touched on the "You really shouldn't f*ck around with the users windows" bit. ;)
jrista
2009-06-25 00:05:02
I wonder how many developers of these annoying 'features' we've given help to :P
alex
2009-06-25 00:12:48
jQuery is not always the answer after all
BlackTigerX
2009-06-25 00:15:18
Wow! Turns out I had my FF set to disable window resizes which is why I couldn't get resizeTo to work hahaha. Guys, believe me I know how annoying this is and I have spoken up about this. But what a client wants a client gets.
2009-06-25 00:23:48
@Robert I think it's disabled by default, as is changing the window.status
alex
2009-06-25 00:32:28