Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames problem

Status
Not open for further replies.

liam147

Technical User
Jul 14, 2003
5
IE
Hello
Does anyone know is it possible to have a link on a frames-based site that changes all the frames rather than just points to one of the frames. I am trying to finsh off a site started by someone else. They have started with frames so I don't want to change at this stage. However every page on the site is supposed to be bilingual (English/Irish) with a link on every page to the other version.
I don't know how to have a link on a frames site that changes all (in this case) three frames rather than just points to one of the frames.
Is there any way to do this?
 
You will need to use Javascript to load new pages into each frame.

Dreamweaver has a built in behaviour to achieve this.

Code:
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

Then each link needs to be made something like this...

Code:
<a href="#" title="My Link" onClick="MM_goToURL('parent.frames[\'leftFrame\']','./newNavPage.html','parent.frames[\'contentFrame\']','./newContentPage.html');return document.MM_returnValue">My Link</a>

The above code is adapted from a 3 frame site. Top, left and content. The link is in the top frame (which incidentaly does not change in this case).
When a user clicks the link it will load "newNavPage.html" into the left frame and "newContentPage.html" into the content frame.

As you can see it will start to get complex very quickly. The code also becomes very bloated and harder to modify.
This is the reason that I tend to shy away from frameset layouts and use CSS or SSI to design around the problems.

- Web design and ranting
- Day of Defeat gaming community
"I'm making time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top