Active Links...with Frames

B

Bob Richardson

My web has 3 frames - Navigation, Header, and Body. Unlike many framed
sites, I want to change both the header and body when a link is clicked on
the Nav bar. At the moment, my needs are met by changing all three frames on
a Nav bar click. There are two problems:
1. I have reload the nav frame every time (minor download time and flicker)
2. the particular link on the nav frame does not stay the active link.

For example,
http://www.writeonwhidbey.org/2005_Conference/2005_Conf_Home.htm

On this page the header is used to hold links to sub-pages. If you click one
of these "header-links" it becomes the active link for that page, and shows
up as WHITE. This is a nice reminder for the user to know where she/he is.

I'd really like to have the appropriate link on the left ("Writers
Conference" on the above page) also be a different color...white...to
indicate that this set of pages is associated with the "Writers Conference."

An unacceptable solution would be to actually have a different Nav bar frame
for each major section. Changes seem to be made too often to the nav bar to
make this a viable solution. Change one and you should really change them
all.

The only solution I can think of is to load only two frames when a nav bar
link is clicked.

Is there a way to TARGET more than one frame; i.e. load two frames out of
three when I click a link?

TIA Bob
 
B

Bob Richardson

This is perfect Mike, but I need a bit more help implementing it. From your
example, it appears that the javascript would go in the Nav frame. Here's
what I have:

<SCRIPT LANGUAGE="JavaScript">
<!--
function changetwo(frame1,link1,frame2,link2) {
parent.frames[frame1].location.href = link1;
parent.frames[frame2].location.href = link2;
}
-->
</SCRIPT>

Then I invoke with:

<a href=javascript:void(0);
onclick="changetwo(1,'About_WIWA/About_WIWA_Header.htm',2,'About_WIWA/About_WIWA_Body.htm');">
About WIWA</a>

What happens -> the Header frame gets "The page can not be displayed..."
error. And the Body frame doesn't change at all. p.s. frame[0] is my Nav
frame.
 
B

Bob Richardson

After further review, I tried this:

<a href=javascript:void(0);
onclick="changetwo('rtop','About_WIWA/About_WIWA_Header.htm',
'rbottom','About_WIWA/About_WIWA_Body.htm');">

but had the same problems. rtop and rbottom are the names I gave to the
header and body frames.

Do I have something wrong in my <SCRIPT> tag?


Bob Richardson said:
This is perfect Mike, but I need a bit more help implementing it. From
your example, it appears that the javascript would go in the Nav frame.
Here's what I have:

<SCRIPT LANGUAGE="JavaScript">
<!--
function changetwo(frame1,link1,frame2,link2) {
parent.frames[frame1].location.href = link1;
parent.frames[frame2].location.href = link2;
}
-->
</SCRIPT>

Then I invoke with:

<a href=javascript:void(0);
onclick="changetwo(1,'About_WIWA/About_WIWA_Header.htm',2,'About_WIWA/About_WIWA_Body.htm');">
About WIWA</a>

What happens -> the Header frame gets "The page can not be displayed..."
error. And the Body frame doesn't change at all. p.s. frame[0] is my
Nav frame.

MD Websunlimited said:
Hi Bob,

You'll need JavaScript to accomplish. Take a look at this example:
http://www.websunlimited.com/samples/frames.htm
--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
 
M

MD Websunlimited

Hi Bob,

Don't use the frame array index number but the name of the frame. See the example.

--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

Bob Richardson said:
This is perfect Mike, but I need a bit more help implementing it. From your example, it appears that the javascript would go in
the Nav frame. Here's what I have:

<SCRIPT LANGUAGE="JavaScript">
<!--
function changetwo(frame1,link1,frame2,link2) {
parent.frames[frame1].location.href = link1;
parent.frames[frame2].location.href = link2;
}
-->
</SCRIPT>

Then I invoke with:

<a href=javascript:void(0); onclick="changetwo(1,'About_WIWA/About_WIWA_Header.htm',2,'About_WIWA/About_WIWA_Body.htm');">
About WIWA</a>

What happens -> the Header frame gets "The page can not be displayed..." error. And the Body frame doesn't change at all. p.s.
frame[0] is my Nav frame.

MD Websunlimited said:
Hi Bob,

You'll need JavaScript to accomplish. Take a look at this example:
http://www.websunlimited.com/samples/frames.htm
--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top