Frames Question: Change banner when changing main frame

G

George Berman

I would like to use a frames page with a "banner and contents" format. When
I bring a page into the Main frame, using a link in the Contents frame, I
want the banner to change to reflect the new contents of the Main frame.

I've come across a few snippets of JavaScript to do this, but have not
gotten them to work properly. Can you helpme?

If you provide HTML or JavaScript, please be clear about just where to put
them. I'm easily confused :-(

TIA
GR Berman
 
T

Thor

Me again. I solved my own problem.

Instead of trying to access the banner through the navigation hyperlink that
brings in the page, I raised my banner from the incoming page, Page1.htm. In
the <head> section of the page, I wrote:

<script language="javascript">
<!--
parent.parent.frames[0].location.href="banner_1.htm"
//-->
</script>

The second "parent" is needed because a "contents & banner" frame nests the
contents and main frames inside a frame that holds the banner. A call to
the outer frame from the inner frame requires two "parent" segments --
otherwise you're addressing the inner frame.

People wishing to use this call elsewhere: note that the frames index begins
with zero.
 
T

Thor

Instead of trying to access the banner through the navigation hyperlink that
brings in the page, raise your banner *from* the incoming page. In the
<head> section of the page, enter

<script language="javascript">
<!--
parent.parent.frames[0].location.href="banner_1.htm"
//-->
</script>

The second "parent" is needed because a "banner & contents" frame nests the
contents and main frames inside a frame that holds the banner. A call to
the outer frame from the inner frame requires two "parent" segments --
otherwise you're addressing the inner frame.

People wishing to use this call elsewhere: note that the frames index begins
with zero.
 

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