'cascading' frames

D

douglas

I am in a Front Page class. We were doing a frames exercise with a
banner, contents, and main frame. The banner had different pets on the
link bar. Selecting a pet caused the contents frame to display choices
specific to that pet.

We started out with the default choice, dogs, on the banner. The
contents frame had dog-specific choices, starting with 'dog food', and
the main frame had info on dog food.

When we selected 'cats' on the banner frame, the contents frame
displayed cat-specific choices, but the main frame continued to show
the dog food info.

Is there any way to change the document loaded in the main frame when
the contents frame changes?

Thanks
 
K

Kevin Spencer

Sure.Use a JavaScript function. Example:

<script type="text/javascript"><!--
function changeFrames(url1, url2) {
window.parent.framename1.document.location = url1;
window.parent.framename2.document.location = url2;
}
// --></script>

<a href="javascript:changeFrames('http://www.microsoft.com',
'http://www.microsoft.com')">Change Frames</a>
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
M

Murray

There is a simpler way, Kevin. You make page 2 load page2b into the content
frame when it loads, e.g.,

in page 2 you have (ALERT - Pseudocode) -

<body onLoad="gotoURL(page2b - target='contentFrame')"
 
K

Kevin Spencer

I suppose what method you would use depends upon your requirements. It
certainly is a different way, though, I'll go along with you there!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
K

Kevin Spencer

Oh YEAH?

--
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
D

douglas

Thanks, Murray.
I've been playing with this for a while now, and can't seem to get it
right.

Here's the code I put into the contents frame:

<body onLoad="gotoURL(catfood.htm - target='main')">

This is the original line from Front Page - I left it below the new
code:

<p><a target="main" href="catfood.htm">Cat Food</a></p>


I put the code into the HTML of the 'feline' page, which is the
contents page for the 'Feline' selection in the banner frame.

I've tried several permutations of this, but can't get it to change
the main frame.

Can you help me?

Thanks again
 

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