Jump to content
xisto Community
Sign in to follow this  
Durdy

Change The Contents Of Two Frames

Recommended Posts

I have a simple frameset of two columns; the first having two rows. By default (if I am correct) a browser sees the first frame as [0], the next as [1], and then [2], and so on for as many frames in the frameset. This code works fine by clicking on the button, the second row of the first column changes, as well as the content in column two.<form><input type="button" Value="Chapter 1" onClick="parent.frames[1].location='sublinks1.htm'; parent.frames[2].location='chap1.htm';"></form>What I want to do is this very same action, but with a typical text link or image, not a forms button. I've tried the <a onCLick=".....">Chapter 1</a> but it doesn't recognize the sctipt between the <a> tags. Any suggestions?Thanks! :lol:

Share this post


Link to post
Share on other sites

warbird that would only change one frame. i think the right way to go at this is in javascript.

put this code into the <head> tag:

<script language="JavaScript">function links1(){parent.frame1.location="sublinks1.htm";parent.frame2.location="chap1.htm";}</SCRIPT>

and then you would put this code into the <body> tag where you want your link to be.

<A HREF="javascript:links1()">Chapter 1</A>

then you just have to watch out to name your frames frame1 and frame2 or whatever you want to call them but change it in the javascript.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.