Change The Contents Of Two Frames

free web hosting
Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Change The Contents Of Two Frames

Durdy
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! cool.gif


Reply

warbird
Just put this in your page: <a href="chapter1.html" target="frame1"><img src="chapter1.gif"></a> and don't forget to give the target frame the name "frame1".

hope I helped
-=jeroen=-

Reply

sxyloverboy
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:
CODE
<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.

CODE
<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.

Reply

warbird
Sorry, my apologises for that. I didn't understand that it had to change two frames, I tought that it was meand to change the second frame.

-=jeroen=-

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. changing css style in other frame - 9.23 hr back. (1)
  2. change css in other frame - 9.35 hr back. (1)
  3. php page with two frames - 10.64 hr back. (2)
  4. change page in frame contents from php - 14.84 hr back. (1)
  5. using buttons to change contents of frame - 25.01 hr back. (1)
  6. php change content - 37.63 hr back. (1)
  7. onclick button target frame firefox - 90.25 hr back. (1)
  8. change two frame url - 95.29 hr back. (1)
  9. change css style in frameset frame - 116.33 hr back. (1)
  10. calling script in other frame in firefox - 118.95 hr back. (1)
  11. php how to link one page with two frames - 152.23 hr back. (1)
  12. html change picture in second iframe - 178.37 hr back. (1)
  13. change 2 frames html onclick - 179.77 hr back. (1)
  14. change 2 frames at same time html - 195.74 hr back. (1)
Similar Topics

Keywords : change, contents, frames

  1. Xhtml, Javascript, Css And Frames.
    (0)
  2. How To Auto Navigate Using Frames?
    (2)
    I have known this for a long time but I have a problem on my site and I need suggestions on how to
    fix it. My site (ycoderscookbook.com) uses frames. There are five frames to be exact, four on each
    side and the center one holds the content. I may just be a baby here but I really like the design
    and I hope not to change it. Here is the problem, I have a JavaScript that places a page in the
    proper frames if navigated to by itself. There appears to be a flaw in the design because it goes
    to the main page if this happens. Even if say code.html is loaded, it always ends....
  3. Big Sites With No Frames
    i cant find a way ! (4)
    You see when you want to make a big website with a navigation bar on each page . you have to put the
    links on every page . And when you want to add a new link you have to add all them to the pages .
    Now there is a way ... iframes are one way but some web browsers do not support iframes . Is there
    any other way i could do this ?....
  4. How Do You Show..
    borders for frames in Firefox? (11)
    Okay, I don't know if it's because of the Firefox browser not supporting this part of the
    HTML code, which I doubt, since it shows up just fine around text, but not sections where graphics
    are. Anyways, here's what the layout looks like in IE: And what it looks like in Firefox:
    And here's the code I'm using that wants to screw with my head, apparently: CODE
    style="border-right:2px solid #003300; border-top:2px solid #003300; border-left-width: 1;
    border-bottom-width: 1; padding: 0"> And that's basically what it looks like for a....
  5. Help Needed With Html, Css And Frames
    I haven't coded in years! (10)
    Okay, the last time I actually coded something it was basic html. I lived of frames and I thought
    that my websites were the best thing on the internet. But just because I had mastered enough to make
    a decent webpage, it still isn't enough. i love coding webpages, but html isn't the best
    script to use. I've been seeing a lot of CSS style sheets and php tutorials, and my favorite
    layouts are all div and table. So, I was wondering, can you target a link into a certain part of the
    webpage on any of these "new" scripts like you could in frames. I don't want to....
  6. Frames
    Need help!! (3)
    Hello, I just added frames to my website, and am unsure how to upload the html to my site. When I
    upload index.html, it doesn't show the other frame. I'm entirely confused... -Kyle....
  7. Frames
    (15)
    Hi I was wondering if anyone had the code for kicking off a frame from you website? Mch Grtfll SDK....

    1. Looking for change, contents, frames






*SIMILAR VIDEOS*
Searching Video's for change, contents, frames
advertisement




Change The Contents Of Two Frames