Results 1 to 8 of 8

Thread: how do I get 2 different targets/frames with the same one CLICK...?

  1. #1
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how do I get 2 different targets/frames with the same one CLICK...?

    Hi guys, Im new to this, though Ive been designing for my own hobbie...Im working on my personal website and I have a particular problem I hope someone could help me with...PLEAAAASE lol.

    Im trying to figure out how is it that I can click on one image (which acts as a link in my header menu) and change the WHOLE page over...
    Im using 2 Iframes: 1 IFRAME for is my HEADER, and another one for my MAIN FRAME (which will have the content once something is clicked on).

    Now I cant figure out how I can click, for example:
    "BIO" and have the header frame change withing itslef (because I designed something else and everything in that iframe thats a button is a ROLLOVER image) BUT ALSO AT THE SAME TIME AS IT CHANGES ITSELF, Open a frame within my MAIN FRAME fo that it can give the CONTENT of the BIO...???

    Is this a little too complicated to explain? I cant find the info anywhere and my dreamweaver is just too confusing since I dont know the first thing about Java...

    I just want to open a new header and a new main frame by clicking on link...so that it's not a boring site...lol

    here's an example without actual "coding" for the links...

    www.wizkilo.com/newsite/hometest/hometest.html

    thanx,

    Wiz Kilo

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, you can't do this with just html, since that only allows a single action per link.

    I think it might be as simple as--
    <a target="headerframename" href="next.htm" onClick="mainframename.location = 'next2.htm';">
    (if that works for you)

    Hmm... I wonder if it would work to just place one link within another.

    <a href="1.htm" target="1"><a href="2.htm" target="2">click</a></a>
    No clue without a good bit of testing. Certainly not standard.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried that, it sounded like it would be logical...but it didn't work...

    What do I do?

    its driving me absolutely bonkers!

    Wiz Kilo

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Maybe someone else will have an idea. I thought the javascript code would work, but maybe there's something about it that can be fixed. I'm not sure.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Assuming you have frames with these names this should work:

    Code:
    <a target="headerframename" href="next.htm" onclick="top.mainframename.location = 'next2.htm';return true;">
    But, it's important where the page with this on it is and where the mainframename is in relation to it, if it is on the top frameset, that should do it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey guys, thanx so much for the help...I actually found this in another thread, that had a link for this Java Script Tutorial...and finally after many hours of searching and trying and trying and trying some more, I found this code that works...

    <A HREF="/newsite/bio/wkheaderbio.html" TARGET="header" onClick="parent.mainframe.location='/newsite/bio/wkbio.html'">

    I needed to put the "parent.mainframe.location='...'" part for it to work properly!

    once again thank you...


    now Im having a CSS Vertical Menu problem that I wrote another thread on...if u guys know anything about it, please check it out maybe ya'll know something that could help me figure THAT problem out, lol...(Java Scripting is a B***! it's HARD)

    Wiz Kilo

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    top, rather than parent, may be a good idea, in that depending on the setup (though yours fits parent at the moment), top may be more versatile.
    top jumps to the uppermost frame, then to the frame you've specified. parent just goes up one. top would work from within two layers, such as from within an iframe in one of your frames.
    However, now, it isn't relevant. Just something to remember for later if it comes up.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Using return true for the onclick event is also a good idea, as it ensures that the link itself will also fire. Having no return value leaves it up to the vagaries of the browsers, which differ.

    Using top or parent is really a matter of which is most appropriate for the situation. Top is the topmost page, parent is the page immediately above the page with the code on it. Often these are both the same page. Often they are different. The overall design of the frameset and it pages determines which is best for you. In extreme cases (where the nesting level could vary on the site with there even, at times, being another page on top beyond the desired frameset and the possibility - not the certainty - of intervening framesets), tests and/or loops might be required to find the actual parent page desired.

    It doesn't sound like this is a factor here. If parent is working for you, go for it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •