Re: iframe help - change two iframes with one click - please ignore
by Will <AskMeAboutItSPAMpunk@[EMAIL PROTECTED]
>
Feb 20, 2004 at 10:00 PM
Arne Hendrickson wrote:
> Can anyone tell me how to edit this script for "traditional frames" to
work
> with iframes?
>
> SCRIPT language="JavaScript">
> <!----hide
> function change2()
> {
> parent.left_frame.location="page3.htm";
> parent.right_frame.location="page4.htm";
> }
> //------>
> </SCRIPT>
>
I can give you something non-specific. Adapt as you need it:
In the body:
<iframe src="One.html" name="Freddie"></iframe>
<iframe src="aDifferentOne.html" name="Francis"></iframe>
The link:
<a href="#" onClick="change2()">Link me up, baby!</a>
The code:
function change2(){
document.Freddie.src="Two.html";
document.Francis.src="aDifferentTwo.html";
/* Cut n' paste URLs as you like it */
}
If you want to change both from INSIDE one of the i-frames (in my
example, lets say 'Freddie'), then change the link to:
<a href="Two.html" onClick="change2()">Link me all over!</a>
And remove the first line of code in the function, edit the second, to
make it:
function change2(){
parent.Francis.src="aDifferentTwo.html";
/* Cut n' paste URLs as you like it */
}