views:

423

answers:

1

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
+1 for "She's waiting for you!"
karim79
Great answer...glad you touched on the "You really shouldn't f*ck around with the users windows" bit. ;)
jrista
I wonder how many developers of these annoying 'features' we've given help to :P
alex
jQuery is not always the answer after all
BlackTigerX
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.
@Robert I think it's disabled by default, as is changing the window.status
alex