• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Managing Browser Windows > 6.3. Maximizing the Main Window

Maximizing the Main Window

NN 6, IE 5

Problem

You want to expand the browser window so that it occupies the same screen real estate as a maximized (Windows) application window.

Solution

Use the following function, which operates best in Internet Explorer 5 or later and Netscape 6 or later:

function maximizeWindow( ) {
    var offset = (navigator.userAgent.indexOf("Mac") != -1 || 
                  navigator.userAgent.indexOf("Gecko") != -1 || 
                  navigator.appName.indexOf("Netscape") != -1) ? 0 : 4;
    window.moveTo(-offset, -offset);
    window.resizeTo(screen.availWidth + (2 * offset), 
                   screen.availHeight + (2 * offset));
}

Although the window may occupy the entire screen and appear to be maximized (in the Windows OS sense), the browser is not officially maximized.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint