Is there a way to get one link to change two frames?

Discussion in 'Web Design & Coding' started by Shade2074, Oct 30, 2004.

  1. Shade2074

    Shade2074 OSNN Addict

    Messages:
    83
    Hello,

    I have an html question and wanted to know if this is possible. I am creating a web page that would contain 3 frames. To make this easy I will number the frames in the example below:

    1. One would be the left column; this would be used for links to various sections of the documents.
    2. One would go across the top; this would be used to show the topic of what general link they are currently viewing.
    3. The final frame would be the main page in the center.
    Here is the problem though; I would like to make it so that when I click a link from frame 1. it will not only change frame 3. but it will also change frame 2. so that it reflects a title with the new topic presented in frame 3.

    I guess what I want to do is have a clicked link change two frames to two different pages.

    Is there an easy way of doing this?

    If not, is there a way to make it so that when I click a link from frame 1 it will load a page into frame 3, and when frame 3 loads it will somehow send a command to change the title in frame 2 (or automatically on load send a link to frame 2 I guess). Would this be a better solution? Sorry lol brainstorming as I write this...

    I'll try to experiment a little on my own but any input on how I can achieve this would be great. Thank you in advance.
     
  2. Feda

    Feda OSNN One Post Wonder

    Messages:
    1
    Location:
    Washington
    I'm not very good with web programing, but I gues that you could ad an OnLoad event to the frame that you link to that would open a new page in the other frame.
     
  3. Shade2074

    Shade2074 OSNN Addict

    Messages:
    83
    I think your right, I can't seem to find any way to make a link do two things at once. Now I just need to figure out the code to make that work. Thank you for the reply. :)
     
  4. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    what style of changes do you want?

    something like clicking on a menu link and then displaying the main content of the link as well as some submenu items??
     
  5. Lukas

    Lukas Real Name No Gimmicks

    Messages:
    421
    Hi guys...

    First of all, I'm kinda stoned and it's 06.15 am here (don't ask) so if this doesn't make sence just ignore me.

    How about creating a link like
    Code:
     
    <a href="document_in_frame_2" target="frame2">link</a>
    
    and then adding an "on-click" event to that link with Javascript...

    Code:
     
    <a href="document_in_frame_2" target="frame2" onclick="NewWindow(....">link</a>
     
    would that work?

    You could also check out dynamicdrive.com and check out their pop-up windows generator and alter that code to open the frame.

    Maybe you could use Window.Location function too...




    Grtz,


    Lukas
     
  6. Shade2074

    Shade2074 OSNN Addict

    Messages:
    83
    I wanted it to be kind of like chapters in a book. I click a link, and then the main page will come up in its frame, and the title frame would show what chapter you are in at all times. So for instance If I click chapter 2 in the links frame, the title frame would say chapter 2, and you could read chapter 2 in the main frame. When I click chapter 3, the title frame would say Chapter 3 and you could read chapter 3 in hte main frame. Kind of like that.

    As to the java script post, the problem with java script is that I would still like it to be widely available for most browsers. Unfortunately I have no idea what my audiance is using. I get the feeling though that some may have java script turned off.
     
  7. Lukas

    Lukas Real Name No Gimmicks

    Messages:
    421
    I dont think this is doable with only HTML... But hey, I dont know if my above post would work either.


    Why do you get the feeling that some of your users turn off js? You could just put up a note on your site that your webpages require JavaScript to be dipslayed correctly.

    Grtz,

    Lukas
     
  8. CHiLLaXen

    CHiLLaXen hypnotika

    Messages:
    107
    Location:
    Minnesota
    you could do a little hack. frame 1 loads the first frame, frame 2 loads a html doc that loads 2 more frames.
     
  9. Shade2074

    Shade2074 OSNN Addict

    Messages:
    83
    OK I got it to work. I decided to go ahead and use javascript and like you said just let people know on the main page that they will need it enabled if they want it to work. (I think I can actually make this note appear only when the script doesn't run too which should also work.)

    Basically I did this, I click the link on the left frame and the main page has an onload event to open the title url in topframe.

    Thank you guys for the help! I appreciate it.

    :)