Click to See Complete Forum and Search --> : anchor # problem


blairr
04-12-2005, 01:21 PM
When you use the # to position the page at the #name, it moves the whole page up so that the #name is at the very top of the page.

My problem is that the anchors I want to display are in an iframe and I just want the page within the iframe to scroll, not the entire parent document.

Can this be done?

Cheers.

A1ien51
04-12-2005, 02:08 PM
how are you calling the anchors that the whole page is moving? Page online?

the tree
04-12-2005, 02:19 PM
Does this work?<a href="#nameofanchor" target="nameofiframe">Link Text</a>

blairr
04-12-2005, 02:23 PM
thanks, A1ien, Tree.

I don't have the page on line yet.

I'm calling them from within a cell rollover

onMouseOver="background='/images/button.jpg'; document.menu.location='menu.htm#2'"

I thought I was being clever by making an iframe to hold the menu options. It's the visual equivalent to a css or javascript menu but has the advantage of being plain html. It does work fine when each menu has its own page, but when I tried to place them all on one page and use the #anchor, it throws the parent frame off by scrolling the whole thing up so that the anchor is displayed at the very top.

I added another #anchor to the end of the onmouseover line to bring the page back down again, but it makes the page shake like an earthquake.

If it's not possible with #anchors, I can do it the other way. But I was trying to keep it as simple as possible so if anyone can think of another workaround, I'd appreciate it.

Cheers.

the tree
04-12-2005, 02:35 PM
I thought I was being clever by making an iframe to hold the menu options. It's the visual equivalent to a css or javascript menu but has the advantage of being plain html.I can't really see that that's a great advantage, surely you'll be using some CSS to format it anyway?

If you need some help with a CSS menu, then just ask.

Really, always try to avoid JS for essential things like navigation.

blairr
04-12-2005, 02:58 PM
Cheers, Tree.

I'm not opposed to using CSS menus, the only issues are all the css menu examples I've seen look and work great when used on a blank page, but when I try to integrate them into my existing layout, they mess the design up or call for a major re-coding;

And I'm more a graphics guy than a coder, but I can pretty much work out and understand enough to tweak source here and there, but when I'm going to leave it after completion to a novice who more than likely will break the page if they try to edit it, I'd prefer to leave them with something as simple as possible- hence a single menu page with a table full of links that they can wisinyg to their hearts content.

Is there something similar to the #anchors or a show/hide that I can use in css?