Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.


1 Answers

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

like image 99
cletus Avatar answered Jan 22 '26 17:01

cletus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!