Frame Names


Normally, a hyperlink within a frame changes only the content of that particular frame, but now there is an addition to the <a> tag: target=frame_name. The frame_name is specified with the <frame> tag. Let's do a simple example:
<html>
<head>
<title>Target</title>
</head>

<frameset cols="50%,50%">
	<frame name="west" src="west.html">
	<frame name="east" src="white.html">
</frameset>

</html>
And this is the coding of west.html:
<html>
<head>
<title>West</title>
</head>

<body bgcolor="#000000" text="#ffffff" link="#ff0000" alink="#ffffff" vlink="#ffffff">

Change the content of the right hand frame to 
<ul>
<li><a target="east" href="blue.html">Blue</a>
<li><a target="east" href="white.html">White</a>
<li><a target="east" href="red.html">Red</a>
</ul>
</body>
</html>
You don't have to make any changes to red.html, etc. Also, all ``normal'' hrefs, i.e. the ones without the target tag, only have effects on the frame they are displayed in.

As a more complex example, you can augment france.html with names:

<html>
<head>
<title>France</title>
</head>

<frameset cols="33%,33%,33%">
	<frame name="bretagne"      src="blue.target.html">
	<frame name="ile_de_france" src="white.target.html">
	<frame name="lorraine"      src="red.target.html">
</frameset>

</html>
A page with targets would look like this:
<html>
<head>
<title>Blue</title>
</head>

<body bgcolor="#0000ff" text="#000000" link="#ffffff">
<h3>This page intentionally left blue.</h3>
<dt>Target: Bretagne
        <dd><a target="bretagne" href="white.target.html">White</a>
        <dd><a target="bretagne" href="red.target.html">Red</a>
<p>
<dt>Target: Ile de France
        <dd><a target="ile_de_france" href="white.target.html">White</a>
        <dd><a target="ile_de_france" href="red.target.html">Red</a>
<p>
<dt>Target: Lorraine
        <dd><a target="lorraine" href="white.target.html">White</a>
        <dd><a target="lorraine" href="red.target.html">Red</a>
</dl>

</body>
</html>
As you can see, any name can be used for frames. The most popular naming schemes are the desired location (north_east, right) and functional description (content, icon_bar, side_show_bob) etc.

There are two ways to break out of frameset structures, the magic target names "_top" and "_parent". While the former one replaces all frames in the browser window with the hyperlink, the latter one breaks only out of the innermost frameset. A little confusing! But don't worry, you are in good company. The authors of Netscape 2.x got it wrong themselves, and implemented "_parent" as "_top". With Netscape 3.x however you can see the difference between the two. Let's consider the flag with the bottom bar again. This time, we add hyperlinks to the white page:

<html>
<head>
<title>White</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#ff0000">
<h3>This page intentionally left white.</h3>
<a target="_parent" href="white.break.html">Break out of innermost frameset.</a>
<p>
<a target="_top" href="white.break.html">Break out of all framesets.</a>
</body>
</html>
See the whole thing in action.

INDEPENDANT PRACTICE

Create a small dictionary. Split the screen into two frames, using a suitable size for each frame, one frame containing the keywords and the other frame containing their explanations. Once a keyword is clicked, the matching entry in the explanation frame should be shown at the top of the frame.


NEXT Other Features

Hosted by www.Geocities.ws

1