Closed Thread Icon

Preserved Topic: Loading multiple frames at the same time (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=20429" title="Pages that link to Preserved Topic: Loading multiple frames at the same time (Page 1 of 1)" rel="nofollow" >Preserved Topic: Loading multiple frames at the same time <span class="small">(Page 1 of 1)</span>\

 
acidbox
Bipolar (III) Inmate

From: purgatory
Insane since: Mar 2001

posted posted 02-01-2002 07:02

It's been awhile since i've had to do this, but i have 3 frames, and i want to click a link on 1 frame and make the content in the other 2 frames change.... could someone please spot me the code? Thanks.

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 02-01-2002 09:11

To achieve this, you'll need a little bit of JavaScript which you should place between the <head> </head> tags in your document:

code:
<head>
<script type="text/javascript">
<!--
function twoFrames(URI1,F1,URI2,F2) {
Frame1=eval("parent."+F1);
Frame2=eval("parent."+F2);
Frame1.location.href = URI1;
Frame2.location.href = URI2;
}
// -->
</script>
</head>


Now you have a function that you can call from every link in your navigation frame like this:

code:
<a href="javascript:twoFrames('this-page-appears-in-the-frame-called-top.htm','top',
'and-this-one-in-the-frame-called-bottom.htm','bottom')">some text</a>



The second and fourth parameters specify the names of the frames the pages you pass with parameters one and three will be loaded.

have fun!
kuckus

//edit: added a little line break to the code...

[This message has been edited by kuckus (edited 02-01-2002).]

acidbox
Bipolar (III) Inmate

From: purgatory
Insane since: Mar 2001

posted posted 02-01-2002 19:53

thanks kuckus, but in actuallity, i found an easier way to do this.

I made a regular link and just added a little onclick statement in the link:

<a href="page2.php" onClick="parent.frame2.location = 'page3.php'" target="frame3">

works like a charm. thanks for your effort though, much appreciated.

« BackwardsOnwards »

Show Forum Drop Down Menu