Maximizing a window
Question: How do I maximize a window?
Answer:
To maximize the browser window, script code can get the available screen size
and then resize the window to the user's screen size.
Just like the function maximizeWindow() { if (top.moveTo) top.moveTo(0,0); if (top.resizeTo) top.resizeTo(screen.availWidth,screen.availHeight); if (top.outerWidth) top.outerWidth = screen.availWidth; if (top.outerHeight) top.outerHeight = screen.availHeight; }A couple of remarks: 1. JavaScript code cannot change the look of the maximize button (the second button in the top right corner of the browser window under Windows operating systems). 2. There was no reliable way to determine the screen size in IE3 or Netscape Navigator prior to version 4 (except for calling Java from Navigator 3.x). Therefore, the example above only works in versions 4 and newer. |
Copyright © 1999-2011, JavaScripter.net.