Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames & Internal Links

Status
Not open for further replies.
Mar 29, 2002
33
US
Looking for a little help with my problem below. I have one page with two frames and the frames should link internally. However, instead of the left frame linking to the desired section in the right frame, the right frame data replaces the data in the left frame. I'm trying to create a table of contents in the left frame and a link those contents to those corresponding sections in the second frame. I can get it to work with a page and one frame, but not frame to frame.
Thanks-

------------------------------------------------------------

MAIN PAGE:

<html>
<head>
<title>main</title>
</head>

<body>

<p><iframe name="left" src="left" height="400">Not supported by browser.</iframe><iframe name="right" src="right" width="450" height="400">
Not supported by browser.</iframe></p>


<!-- <frame name="left" src="left" width="300" height="400">Not supported by browser./>

<frame name="right" src="right" width="450" height="400">Not supported by browser./> -->


</body>
</html>

------------------------------------------------------------

LEFT FRAME:

<html>
<head>
<title>left</title>
</head>

<body>

<p><font size="4" color="#0000FF">Pet Information</font></p>

<ul>

<li>
<p style="margin-top: 40; margin-bottom: 40"><a href="right.html#birds">Birds</a></li>

<li>
<p style="margin-top: 40; margin-bottom: 40"><a href="right.html#cats">Cats</a></li>

<li>
<p style="margin-top: 40; margin-bottom: 40"><a href="right.html#dogs">Dogs</a></li>

<li>
<p style="margin-top: 40; margin-bottom: 40"><a href="right.html#fish">Fish</a></li>

</ul>


</body>
</html>

----------------------------------------------------------------------

RIGHT FRAME:

<html>
<head>
<title>right</title>
</head>

<body>

<ul>

<li>
<p style="margin-top: 0; margin-bottom: 0"><em>Birds</em></li>

</ul>

<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<ul>

<li>
<p style="margin-top: 0; margin-bottom: 0"><em>Cats</em></li>

</ul>

<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<ul>

<li>
<p style="margin-top: 0; margin-bottom: 0"><em>Dogs</em></li>

</ul>

<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<ul>

<li>
<p style="margin-top: 0; margin-bottom: 0"><em>Fish</em></li>

</ul>

<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;<p style="margin-top: 0; margin-bottom: 0">&nbsp;




</body>
</html>
 
Your frames have names, left and right, and when you create links you must reference this names in order to tell in which frame you wish them opened. You do this by adding target attribute to your <a> tag. So change your code to read:

<a href="right.html#birds" target="right">Birds</a>

and the same for all the other links. Hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top