Archive of UserLand's first discussion group, started October 5, 1998.

Re: Automatic monitor page re-size html code?

Author:Jeremy Bowers
Posted:12/3/1999; 10:47:09 PM
Topic:Automatic monitor page re-size html code?
Msg #:13432 (In response to 13430)
Prev/Next:13431 / 13433

First, the size of the monitor doesn't matter too much to a web developer. It's the screen resolution that matters.

Resizing code varies between Netscape and IE. Adapted from http://www.bookmarklets.com/tools/windowing/index.phtml (NS) and http://www.bookmarklets.com/tools/windowing/indexE.phtml (IE), the code for Netscape will use things like

window.moveTo(0,0);
window.outerWidth=screen.availWidth;
window.outerHeight=screen.availHeight;

(Note that actually only resizes the screen to take all available space, which isn't quite the same thing as being maximized.)

IE will need

window.moveTo(0,0)
window.resizeTo(screen.availWidth,screen.availHeight-20)

You will need to test availWidth and availHeight for whatever parameters you are checking for. Note that availWidth != screen width and availHeight != screen height; esp. in Windows 95, resolution is not necessarily a good predictor of height. For instance, the Taskbar could be on the side of the screen eating 200 pixels worth of space. Plus, your website will not get that space, the browser gets that space. You get what's left over after the navigation widgets, status bar, menus, etc.

You're probably better off redoing the template to work in the lower resolutions, or deciding not to support the lower resolutions, if your users will put up with that. (If you use dynamically resizing tables correctly, you should be able to make things work well, unless you are just trying to cram too much stuff in.) Besides, I would consider a website resizing my browser for me without asking an act of war, and I doubt I'm alone.




This page was archived on 6/13/2001; 4:53:39 PM.

© Copyright 1998-2001 UserLand Software, Inc.