[Javascript] Resizing browser window

tedd tedd at sperling.com
Fri Jul 28 10:23:25 CDT 2006


At 1:37 AM +0000 7/28/06, Troy III Ajnej wrote:
>Geoff was asking of a way to shrink the main window so he could open 
>another one,
>but make sure the body width fits the given new window size. So he 
>needed to know
>a foreheads what size should the window be set to, in order that the 
>contents will fit properly.
>Since he could get the body width, but not the window width in total 
>including eventual vertical
>scrollbars when present. (At least that's how I understood his problem).
>
>So my approach was as follows:
>
>Get the Browser type by vendor name.
>Check if Vscrollbar is needed, therefore present or not.
>Assign a known scrollbar width to var with alternative values for on or off
>Declare unique browser frame constant widths connected to a BR vendor name.
>Use the detected browser name as instruction to get curr br frame 
>size and set frame variable one-shot.
>Gather all processed var values into our final var making it 
>available for other script demands. So we can finally make the 
>window resize around any given document body width.
>
>Other thing in mind was not to use functions or use up any "event" 
>that may be needed by any other ready scripts on the page.

Interesting problem, but I'm reluctant to change the user's browser 
window in any fashion -- because, something like that would upset me 
if I had my browser window set the way I wanted it and the web site 
changed it.

Besides, I may be way off base, but there's a lot to consider here -- 
browser, browser size, window size permitted by browser, users 
monitor size and resolution, user's zoom level, available space, 
computing overlap (if needed), knowing what other windows may be 
opened, and then there are people like me who have more than one 
monitor (3 for me). It seems improvable to solve for all computer 
monitors, OS's, and browsers.

I try to look at problems from the other side, which is what do I do 
to accommodate the user?

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list