SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 iFrames, 1 link?

    is it possible to click on one link and have that link change the information contained in two seperate iFrames? for instance click a link on a menu and have it change an iFrame containing the page title and another containing the body of the page at the same time?

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    Try somethimg like this.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <title>two frame test</title>
      <script>
      function twoFramechange(nav,content){
      top.iframe1.location.href = nav;
      top.iframe2.location.href = content;
      }
      </script>
      </head>
      <body>
      <iframe name="iframe1" src="http://sitepoint.com"></iframe>
      <iframe name="iframe2" src="http://www.google.com"></iframe>
      <br>
      <br>
      <a href="java_script_:twoFramechange('http://www.google.com','http://www.sitepoint.com');">link1</a>
      </body>
      </html>
    I have it set to switch the 2 sites(SP, Goggle) out in the frames for my example.

    Hope this helps

    Later
    Johnny

  3. #3
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    though I just noticed that it seems to not be working so let me take another look.

    Later
    Johnny

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    It works now that I changed the alternate url's to some other than the original 2.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <title>two frame test</title>
      <script>
      function twoFramechange(nav,content){
      top.iframe1.location.href = nav;
      top.iframe2.location.href = content;
      }
      </script>
      </head>
      <body>
      <iframe name="iframe1" src="http://sitepoint.com"></iframe>
      <iframe name="iframe2" src="http://www.google.com"></iframe>
      <br>
      <br>
      <a href="java_script_:twoFramechange('http://www.yahoo.com','http://www.msn.com');">link1</a>
      </body>
      </html>
    Though I would say it does not seem to be very effective. There may be a better way. Sorry for the confusion

    Later
    Johnny

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey johnny, thanks for the try, though the second one doesn't work either.

  6. #6
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <a href="new_page.html" target="mainIFRAME" onclick="frames.titleIFRAME.location='new_title.html'">link</a>

    imo two iframes on one page is one iframe too many...
    ::: certified wild guess :::

  7. #7
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    adios my man, thank you again for coming through. this works like a charm. and yes, i agree, two iFrames are too manny, though its the only thing i could thing of to make an easy template. but thank you again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •