Navigation Button


Linking the Frames Together

Let's go back to the basic two-column navigation frameset highlighted on the first page of this tutorial. Remember it contained a window for the menu, and another for the general page content.

 <frameset cols="22%,*">
 <frame src="navigation.html" name="Navigation">
 <frame src="main.html" name="Content">
 </frameset>

Notice the addition of the name attribute. That gives the browser's HTML interpreter a moniker for referring to the frame. In the navigation frame's HTML file, you can set up the link list of pages to be displayed in the main content area.

 <a href="main.html" target="Content">Home</a>
 <a href="whatsnew.html" target="Content">What's New</a>
 <a href="aboutus.html" target="Content">About Us</a>
 <a href="tips.html" target="Content">Tips and Tools</a>

Bullseye The target attribute of the <a> tag tells the browser to load the file into a different frame, referenced by the value of the attribute. When your visitor clicks on any of the links in the navigation menu, they'll be loaded into frame "Content", just as you defined in the frameset. If you do not use the name attribute, the navigation frame itself would be overwritten by the new page, and the content frame wouldn't budge. There are other special target options you can use, the underscore ( _ ) is very important.

  • "_self": This option, the default, loads the linked page into the currently selected frame.
  • "_top": This throws all the browser's fancy frame setup out the window, cleans the page, and loads the linked file fresh instead of loading it into the currently selected frame. Commonly used to break out of other people's frames.
  • "_parent": This loads the new page into the currently selected frame's parent frame. If you're using nested frames, the new page is loaded into the frame one level up in the frame tree. If not, "_parent" functions just like "_top".
  • "_blank": This opens a new browser window, selects it, and loads the link into it. Internet Brothers uses this to link to external web sites.

Noframes for Lazy Browsers

At the beginning of this tutorial we mentioned that framing is a fairly recent HTML construct, and as such, is not supported by some older browsers. You should allow for this if you choose to use frames on your site. Be polite to those of your visitors who have been too lazy to download a modern browser by putting the <noframes> tag at the start of the <body> section of your HTML files. Include a comment about their browser not supporting frames, and provide a link to an alternate, non-frames based page. Close the tag set with </noframes>.

Continue With The Good, The Bad, and The Ugly

previous page     top of page     next page

The Internet Brothers have implemented hierarchical menus for navigation. Easier done than said.

The hierarchical menus were created using Peter Belesis' © Dynomat DHTML scripting tool from Webreference. Give them a visit, you'll like what you learn.

Our Lovely Email Icon    another darn bug






Site Map

 

 

 

 

The trouble with being punctual is that nobody's there to appreciate it.

 

 

 

Was this site useful to you?
Vote For Us at WebbieWorld

 

Copyright © 1997-present Internet Brothers. All Rights Reserved. Really.