DreamHost Web Hosting
Discussion Forum


Forums
   >> Web Design
*Threaded Mode

Subject Changing 2 frames with Javascript  
Posted byd_and_k (DH New User )
Posted on08/23/05 12:18 PM



I used this code from a tutorial to change two frames at once, and it worked fine for the first two links, then I used it on all the other links and it wont open anything exept the last link on the list. The url is http://www.darkerkind.com feel free to view source and get back to me. Thanks in advance for your help!

I have a feeling it might be as simple as putting a name on the seperate scripts. But I dont know.

Edited by d_and_k on 08/23/05 12:24 PM (server time).



Subject Re: Changing 2 frames with Javascript new [re: d_and_k]  
Posted bydecswxaqz (DH Enthusiast)
Posted on08/24/05 01:20 AM



Numerous errors are thrown up using firefox.

In reply to:

<A HREF="#" onclick="change2('r1.html',rfrev.html')">~:Reviews:~</A>


Should be changed to

In reply to:

<A HREF="#" onclick="change2('r1.html','rfrev.html')">~:Reviews:~</A>


(missing ' next to rfrev.html)

You also have too many functions called the same thing. I don't think JS supports function overloading but I could be wrong...

Try removing all of the functions (keep a backup somewhere) and replacing them with

In reply to:

<SCRIPT type="text/JavaScript">
function change2(middle_link, right_link){
parent.middle.location = middle_link;
parent.right.location = right_link;
}
</SCRIPT>



Also, you've called your CSS file "mystyle2.css.html", rename the file "mystyle2.css" and make sure you change the link in your HTML, make those changes and I'll try to help with any others that popup :P.




*Threaded Mode
Jump to