View Full Version : Frames targets

11-23-2002, 09:37 PM
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!

11-24-2002, 02:07 AM
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'">

11-24-2002, 02:20 AM

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)


11-24-2002, 02:21 AM
also, you can use a function like this:

function goPage()
for (t=0; t<(destination.length-1); t+=2)

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

11-24-2002, 03:15 AM
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. :)

11-24-2002, 03:24 AM
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! ;-)


11-24-2002, 03:25 AM
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:

<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"

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.