Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Frames targets

  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Location
    California
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Frames targets

    I've got rollovers on my webpage banner buttons.

    I want to make each of those buttons open in TWO places on my frames page (www.rookiesailors.com) - the left panel (contents) and the right panel (main).

    My problem is that I can only get one panel to open, and can't find the right code to target both the "contents" and "main" targets.

    So, is it possible to have one button (with a rollover) target two different pages in a frames page?

    Any help from an html wizzard would be most appreciated!
    Vicky

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I assume you want the pictures in the left frame to correspond with the stuff in your 'main' frame. If that's the case, you can use something like this in the source of your 'left' frame where the pics are:

    <body onload="top.main.location='whatever.html'">

    just change "whatever.html" to the associated html page.

    Hope this helps!

    Nice nickname, by the way.

    P.S. Actually since it looks like you're targeting the main frame already in your other script, try using this on the pages that show in your 'main' frame instead:

    <body onload="top.banner.location='whatever.html'">
    Last edited by whammy; 11-24-2002 at 01:10 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New to the CF scene
    Join Date
    Nov 2002
    Location
    California
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whammy!

    Thanks for your reply. I think I didn't explain clearly that I'm looking to open TWO new pages off the ONE rollover link button.

    I want to have the rollover button in the "banner" (that runs along the top of the screen) to open two different html pages. One html page on the left side called "contents" and a different html page on the right side called "main".

    BANNER (click rollover icon) and open two different screens below it:

    on the left: CONTENTS (opens an html page #2)
    on the right: MAIN (opens html page #3)


    Thanks!
    Vicky

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    also, you can use a function like this:

    function goPage()
    {
    destination=goPage.arguments;
    for (t=0; t<(destination.length-1); t+=2)
    {eval(destination[t]+".location='"+destination[t+1]+"'");}
    }


    and then

    <a href="javascript:;" onclick="goPage('page1.htm','parent.main','page2.htm','parent.left')">go</a>



    btw: this one it's more a javascript question than a html/css one
    Last edited by Borgtex; 11-24-2002 at 01:23 AM.
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually the way I described WOULD open two pages. You'd open the main page, which when it loaded would load whichever page you specified on its body onload tag, in the left-hand link (contents).

    If you want to do it in one function, the function will need some rewriting.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #6
    New to the CF scene
    Join Date
    Nov 2002
    Location
    California
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok Whammy!

    Now my tiny little html brain is totally confused! Are you saying I need code in the

    1) "banner" that directs to the "main" AND
    2) in "main" that then directs to the "contents"?

    I also need to insert the <img src= ... hsrc ...> tag in there too!

    I'm really new at this, so please assume I'm blonde! ;-)

    Vicky

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here, ignore what I said before, and check out how I modified your first rollover (in "banner.htm")... this is just another way to do it:
    Code:
              <td>
                   <a href="javascript:void 0"
                   onclick="top.contents.location='http://www.rookiesailors.com/html/SanJuanIslands/SJIcontents.htm'; top.main.location='http://www.yahoo.com'">
                   <img height=57 src="banner_files/sanjuansmall.jpg" width="86"
                   src="http://www.rookiesailors.com/images/Banner/sanjuanbig.jpg"></a>
              </td>
    P.S. Take out the space in between "java" and "script" in that tag - the forum inserts those...

    I believe that's what you're getting at - but you can just use local paths on your own website, you don't have to use the full path. Actually it's better if you don't in case you change domains down the road.

    This isn't a very elegant way to do it but it's perhaps the most understandable way for someone new to programming. borgtex's way should work, as well.

    You should be able to modify the rest of the code using the example above.
    Last edited by whammy; 11-24-2002 at 02:36 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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