Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to resize the browser window to full screen size when it loads in Internet Explorer


View products that this article applies to.

Summary

This article describes how to use JavaScript to automatically resize the browser window to the maximum height and width when the window is loaded within a Web page.

↑ Back to the top


More information

  1. In Page view of Microsoft FrontPage, click the HTML tab.
  2. Insert the following JavaScript just below the <HEAD> tag:
    <script language="JavaScript">
    window.onload = maxWindow;
    
    function maxWindow()
    {
    window.moveTo(0,0);
    
    
    if (document.all)
    {
      top.window.resizeTo(screen.availWidth,screen.availHeight);
    }
    
    else if (document.layers||document.getElementById)
    {
      if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
      {
        top.window.outerHeight = screen.availHeight;
        top.window.outerWidth = screen.availWidth;
      }
    }
    }
    
    </script>
    					
When the page that has the JavaScript is loaded, the browser window is maximized. Notice that the window is not fully maximized to fill the whole screen, and you can drag the mouse to resize the window. In addition, the maximize button is still available if you want to fill up the screen with the window. The preceding code resizes the current browser window to the maximum height and width that are available for the screen resolution and allows the border of the window to still be visible.

↑ Back to the top


References

For additional information, visit the following Microsoft Developer Network (MSDN) Web site:

Web development

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: KB287171, kbscript, kbhowto, kbdhtml

↑ Back to the top

Article Info
Article ID : 287171
Revision : 4
Created on : 6/19/2012
Published on : 6/19/2012
Exists online : False
Views : 260