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

Chapter 18.  JavaScript Essentials > Controlling a New Window's Size

Controlling a New Window's Size

In Chapter 7, you learned how to open a link in a new window. JavaScript lets you control how big that window should be.

To control the size of a new window:

1.
Type <A HREF="javascript:location='current.html';, where current.html is the URL of the page that contains the link.

2.
Type window.open('nextpage.html',, where nextpage.html is the URL of the page to be opened in the new window.

3.
Type 'label',, where label is the name of the new window.

4.
Type 'HEIGHT=h,WIDTH=w, where h and w are the desired height and width for the new window. (No spaces!)

5.
If desired, type ,windowpart=yes, where windowpart is scrollbars, toolbar, status, menubar, location, or resizable.

6.
If desired, type a , (comma) and repeat step 5 as desired. Each window part should be separated from the previous one with a comma but no spaces.

7.
Type ' (a straight apostrophe)—whether or not you've set the window parts.

8.
Type )' to finish the JavaScript code.

9.
Type >clickable text</A>.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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