Web Analytics Made Easy -
StatCounter One button..two links. - CodingForum


No announcement yet.

One button..two links.

  • Filter
  • Time
  • Show
Clear All
new posts

  • One button..two links.

    Okay I'm assuming to the best of my knowladge to pull this off I would use something to the extent of a mouseOver with an OnClick in java script, but I have one issue with java..if it's not cut and paste..I suck at it..so here goes.

    I have two Iframes. One on top, one below.
    The one on top shows an image.
    The one below shows information.
    When they click on a link to change the information, I also want that link to change the image in the iframe above.


  • #2
    <a href="linktoinfo.html" target="[i]nameofbottomframe[/i]" onclick="parent.frames['[i]nameoftopframe[/i]'].location='someotherpage.html'">Two Links</a>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


    • #3
      Alright, I tested it out, and it's not targeting the first link to content, it's opening a new window all together.

      I put up the test at


      • #4
        That coding is for actual frames not IFrames which is what I'm using. I found this [http://www.samisite.com/test-csb2nf/id82.htm]in reference finally, aparently if you want to do this in IFrames you have to use java.

        But even using their code I can't get mine to work >.< just says error on page when I click the link

        Line: 7
        Char: 1
        Error: 'parent.FRAME1.location' is null or not an object
        Code: 0
        URL: http://symplig0thic.com/TestLink.html
        And upon further investigation it seems like doing this in IFrames is more of a pain in the arse than it's worth..but I know it can be done and functionally so..however with the magnitude of this site, I'm not sure if the hassle will be worth it.
        Last edited by SympliG0th; Oct 14, 2006, 06:07 AM.


        • #5
          What I gave you would work, you just have to understand what a name of an frame or iframe really is. It seems that you don't. Your second iframe code has name="main" but so does your first one so your second iframe needs to be
            <iframe width="150" height="315" src="content.html" [b]name="main2"[/b] id="main2" border="0" frameborder="0" scrolling="auto" allowtransparency="true"> 
            <iframe width="150" height="315" src="content.html" name="main" id="main2" border="0" frameborder="0" scrolling="auto" allowtransparency="true"> 
          Now what I gave you would work IF you used the right iframe names which you didn't.
          <a href="linktoinfo.html" target="main" onclick="parent.frames['main2'].location='someotherpage.html'">Two Links</a>
          ||||If you are getting paid to do a job, don't ask for help on it!||||