PDA

View Full Version : help with changing two frames at once!


aussie
08-12-2004, 11:56 PM
i have a website (which should be available to see) with three frames: intralinks (top), links(b left) and content(b right).

There are five links in the top frame that link to other sections of my website. the first is the home page, 2nd, 3rd and 4th all link to information on diffrent games.

I currently have them only changing the content frame, but I need them to change the links frame to provide related links about the topics. Here is my javascript code so far, it is just a test so I am only providing the code to chage between Home and Game 3.

<script language="javascript">
Function link(link){
if (link==1){
parent.links.location.href="otherlinks.html";
parent.content.location.href="home.html";
}
if (link==2){
parent.links.location.href="mm9/mm9links.html";
parent.content.location.href="mm9/mm9_main.html";
}
}

</script>

here's the code in the links that change the frames.
<a href="javascript:link(1)"> for Home.
<a href="javascript:link(2)"> for Game 3.

all this code is in the top frames html file. When I click on either link, there is an error and nothing happens.

Could someone please tell me what I have done wrong and what I need to do to fix it. Thanks in advance.

Additional Info:
- there are 4 pages controlling the frame layout, index (has the frameset code), intralinks (top frame), otherlinks (bottom left frame) and home (original source for content frame)

agent002
08-13-2004, 02:49 AM
Originally posted by aussie
all this code is in the top frames html file.
It uses "parent", so it should be on the frame page, not in the frameset.

aussie
08-15-2004, 06:55 PM
Problem solved, but thanks anyway, I replaced 'parent' with 'top' and it works.