views:

45

answers:

2

Is there a jquery way or plugin to detect the visitor's browser window size when they first come to the page and auto stretch the browser for them if it's too small?

It's a pretty common thing that I've seen done a few times, so I'm guessing someone here will know about it.

A: 

window.resizeto google something :)

Val
+2  A: 

Don't do this, most browsers prevent this from happening, for good reason.

Would you like me to come stretch your email client across both monitors so you can't work? Why should a web browser be treated any differently? Some decisions are for the user this is definitely one of them.

The users has expectations browsing the web, doing things like this breaks those expectations. If I had 20 tabs open in chrome (and often do, on several windows), I don't want your site to resize the other 19. It does however make me want to hunt you down with a salad fork and stab it in your eye.

Nick Craver
Can be useful if you can *guarantee* that the page is in a smaller popup window (phpMyAdmin's query window does this). But for a regular full-size site - incredibly annoying.
DisgruntledGoat
@DisgruntledGoat - I agree in *very* limited cases this is true, when it's something the user opened by an action, this is why `window.open()` can take size arguments, and browsers still (be default) respect them.
Nick Craver
@Nick, thanks for the response. Why would it resize all other 19? Isn't there a way to resize just the current browser window?
goodan
@goodan - Since browsers have tabs not, no...not unless you're in a popup window already. Also, can you guarantee I'm not on a 800x600 monitor? There is a long list of reasons *not* to do this :)
Nick Craver