Click to See Complete Forum and Search --> : frames-links on one side, pages on the other


new web kid
04-11-2003, 07:26 PM
Hi,
I'm new to web design and need a little help. I'm making a page using frames. The left frame contains links and the right frame is the target for all the links. When I click on a link for the first time, the result shows up in the right frame. When I click on any other link, a new window opens and displays the page the link points to. How so I stop that from happening? I want the right side to always be the target for any link. ANy help would be appreciated.

Jona
04-11-2003, 10:34 PM
Okay, your frameset page:

<frameset>
<frame target="leftFrame" src="left.html">
<frame target="rightFrame" src="right.html">
</frameset>

(Of course, keep your sizes and all that other stuff, just make sure your targets are in there.)

Your left.html frame:

<a href="file.html" target="rightFrame">File</a>

Your right.html frame:

<a href="file.html" target="_self">File</a>

That good?

Albatross
04-12-2003, 04:44 PM
I see you beat me to the punch here.


(for the original poster) Sorry about interrupting your thread, but I have a question that relates to this topic.

My frameset is set with two frames, "left frame" and "right frame". On the left frame is a menu bar. On the right frame is the main area. My menu bar is being set up so it can display portions of the target file (using named anchor tags **<a name="target">blah blah blah</a> and <a href="/html#target"> respectively**). My problem is simple. I cannot get the main file to automatically load when I click on the link (during testing).

My menu consists of a folder named "Directory", with html files for every menu file. Here's an example:

<font size="1"><a href="/mainarea.html" target="right frame" a target="_self" href="/directory/index.html" onmouseover="window.status='Main'; return true">Main Page</a><br>
<a href="/directory/history.html" target="_self" onmouseover="window.status='History'; return true">History</a><br>
<a href="/directory/society.html" target="_self" onmouseover="window.status='Society'; return true">Society</a><br>
<a href="/directory/government.html" target="_self" onmouseover="window.status='Government'; return true">Government</a></font>

Now suppose the user were to click on "history".

This file would appear in the left frame:

<font size="1"><a href="/mainarea.html" target="right frame" autoload="true" a target="_self" href="/directory/index.html" onmouseover="window.status='Main'; return true">Main</a><br>
<a href="/history.html" target="right frame" a target="self" href="/directory/history.html" onmouseover="window.status='Clan History'; return true">History</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#origins" onmouseover="window.status='Origins'; return true">Origins</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#early" onmouseover="window.status='Early History'; return true">Early History</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#golden" onmouseover="window.status='The Golden Century'; return true">The Golden Century</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#drive" onmouseover="window.status='The Drive to War'; return true">The Drive to War</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#revival" onmouseover="window.status='Operation Revival'; return true">Operation Revival</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#truce" onmouseover="window.status='The Truce Years'; return true">The Truce Years</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="right frame" href="/history.html#outlook" onmouseover="window.status='Outlook to the Future'; return true">Outlook To the Future</a><br>
<a href="/directory/society.html" target="_self" a target="right frame" href="/society.html" onmouseover="window.status='Society'; return true">Society</a><br><a href="/directory/government.html">
<a href="/directory/government.html" target="_self" a target="right frame" href="/government.html" onmouseover="window.status='Government'; return true">Government</a></font>

First, I would like to apologize for the length of this (this is only a portion of the two respective codes). What happens when the user clicks on the "History" file is the menu bar for "/directory/history.html" appears, but the actual "/history.html" file does not appear on the right frame unless the "History" link is clickd again. Is there a way to correct this?

Second, when the mouse curser rolls over the links, the link description appears like it is supposed to. However, when the curser leaves the link, the description remains. Is there a way to remove this without removing the link description attribute?

(all the advice on this particular inquiry would also be a great reference for the original poster should he/she decide to do this as well)

new web kid
04-14-2003, 10:34 AM
Jona, thanks for teh help but I think I asked the question wrong. The right frame contains no links whatsoever. Just the page to the link from the left frame.

mt code:
<FRAMESET COLS="25%, 75%">
<FRAME NAME="A" SRC="\project3\linkpage.htm" >
<FRAME NAME="B" SRC="\project3\default_page.htm">

</FRAMESET>

right now, all the links just go to some webpages (cnn.com, msnbc.com, etc) If I click a link (cnn for example) then it shows up in the right (B) frame, then if I click on another link (msnbc) a browser opens up instead of it opening up in the right frame. I have all the targets set to the right frame.

Albatross
04-14-2003, 12:05 PM
It's usually impolite to use other people's sites within your frames. But as long as you ask for their permission beforehand it should not be too much of a problem (It is one of the main reasons why people hate frames so much--even though they have no idea what they could be missing out on ;).)

new web kid
04-14-2003, 12:10 PM
Thanks for the etiquette lesson. The links to other sites are just an example. When everything is done, they will point to other webpages on the server. I just wanted to work out the code before I wasted time making a bunch of webpages that don't work.
But thanks for chiming in.

Albatross
04-14-2003, 12:12 PM
no problem. If you need any more help, feel free to either PM, email or IM me. My contact info is in my profile.

(personally, I would prefer the IM, since I only check my hotmail account once a day)

new web kid
04-14-2003, 12:13 PM
:rolleyes:

nkaisare
04-14-2003, 04:20 PM
Taking Jona's example:

<frameset>
<frame target="leftFrame" src="left.html">
<frame target="rightFrame" src="right.html">
</frameset>


Consider a part of the file "left.html"
<p><a href="file.html" target="rightFrame">Link 1</a></p>
<p><a href="file.html" target="leftFrame">Link 2</a></p>
<p><a href="file.html" target="_self">Link 2</a></p>

Clicking Link 1 will open the file in the right frame, while clicking Link 2 in the left frame and clicking Link 3 in the same frame (i.e. left frame in this case).

The event handler onmouseover("window.status='History'") will display "History" in the status bar when you roll your mouse over the link. Event handler onmouseout("window.status='Whatever you want'") will display "Whatever you want" when you move the cursor away.

There is no HTML way of opening two files by clicking a single link. If you want historyL.html and historyR.html to open in left and right frames respectively, you can do one of the following:
1. Create anothe file history_frame.html with
<frameset>
<frame target="leftFrame" src="historyL.html">
<frame target="rightFrame" src="historyR.html">
</frameset>
You will have to change the link to <a href="history_frame.html" target="_top">History</a>

2. Use javascript:
<a href="historyR.html" target="rightFrame" onclick="window.self.location('historyL.html')">

Albatross
04-14-2003, 07:44 PM
Are you saying the code should be:

onmouseover="window.status='LINK DESCRIPTION'; return true" onmouseout="window.status='LINK DESCRIPTION'; return true" ?

What if I want to leave the onmouseout command empty? What should I put in then? I think it's notextdecoration, but I could be wrong.