Controlling the Size of a New Window

Home >> Javascript & CGI>> Controlling the Size of a New Window

You can use javascript to tell a window how to behave.  Below you'll learn how to customize / re-size a new browser window when a user clicks on a link to the page.  

This tutorial does not show you how to create a new pop up ad/ window when a page loads.  It shows you how to control the size and location of a window when a user clicks on a link from one page to go to another.

Here's the basic code you will use to link to the new page / window that you will be customizing:

 Here are the variables you can change in the code.

Variable Value Behavior
height number Height of the new window (in pixels)
width number Width of the new window (in pixels)
linkname text Name of Link
scrollbars yes/no Controls whether horizontal or vertical scrollbars are shown

If you liked this, please share. Thanks!