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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question please.. 2

Status
Not open for further replies.

coldfused

Technical User
Jan 27, 2001
2,442
US
Say I have a frameset..And im my frameset I have this button that changes the main content frame back to the home page:

<td><a href=&quot;content.htm&quot; target=&quot;content&quot;><img src=&quot;images/home.gif&quot; alt=&quot;Return Home&quot; name=&quot;home&quot; width=&quot;150&quot; height=&quot;20&quot; border=&quot;0&quot; onload=&quot;&quot;></a></td>

Now I want to be able to have another button the same way change to frames at once, ie: change the left frame and the content frame at the same time..

Is that possible? If so what would the link look like?
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Sorry that was &quot;change two frames at once..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
In order to change two frames at once you need a JS function:

function loadtwo() {
parent.frame1.location.href = &quot;first.htm&quot;;
parent.frame2.location.href = &quot;second.htm&quot;;
}

where frame1 and frame2 are the names given to your frames in a frameset.

Call it like this:
<a href=&quot;#&quot; onclick=&quot;loadtwo()&quot;><img src=&quot; ...></a>
 
Thanks alot..


Carl
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
ok but this only sets it up to go to these two pages how can i work it then in the function where i specify the url in the <a> tag....so onclick in your method will go to first.htm and second.htm what if i have a third.htm and a fourth.htm [soapbox]
sleep is good
 
Very simple:

function loadtwo(url1, url2) {
parent.frame1.location.href = url1;
parent.frame2.location.href = url2;
}

<a href=&quot;#&quot; onclick=&quot;loadtwo('first.html', 'second.html')&quot;><img src=&quot; ...></a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top