Robert Pasbani
Robert Pasbani

Reputation:

How do I change the browser width/height in jQuery?

Can't figure this out for the life of me. Google is no help either. I'm sure its super easy.

Upvotes: 2

Views: 3161

Answers (1)

cletus
cletus

Reputation: 625017

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().

Upvotes: 15

Related Questions