[Javascript] Maximizing your own window

William T. Simmons tsimmons at employmentlawadvisors.com
Wed Oct 8 00:09:48 CDT 2003


Robert,
This works for me (square brackets substituted for angle brackets for
readability in diverse clients):

[script language=JavaScript][!--
resizeTo(screen.availWidth,screen.availHeight);
--][/script]

That will resize a page loaded into a non-maximized window, i.e., maximize
the window, if included after the opening BODY tag. To invoke the maximizing
code from a button or other type of link, you can make a form button and
give it the following onClick event handler:
onClick="javascript:resizeTo(screen.availWidth,screen.availHeight)"

If the window is non-maximized and not tiled to the top left corner, you can
maximize it and tile it to the top left corner with the addition of a
"moveTo" statement:
onClick="javascript:resizeTo(screen.availWidth,screen.availHeight);
moveTo(0,0)"

HTH,
Tommy Simmons
Employment Law Advisory Network
www.employmentlawadvisors.com

----- Original Message ----- 
From: "Robert Wall" <bob at web-walrus.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Tuesday, October 07, 2003 6:23 PM
Subject: [Javascript] Maximizing your own window


> How does one go about seizing control over the size of the current window?
> I'm basically looking for code that maximizes the window, regardless of
> browser settings.
>
> Any help you could give would be greatly appreciated.  :)
>
> -----
> Robert Wall (715) 855-0189
> Systems Administrator                                   bob at web-walrus.com
> Web Walrus Media
>
>             "Affordable internet solutions for your business"





More information about the Javascript mailing list