View Full Version : Javascript drop-down menu link to html anchor

May 9th, 2005, 04:19 PM

I've created a drop-down menu in Fireworks and need to link the menu links to a web page that I have already inserted html achors into. The menu code (sample) looks like this:


I have about 10 menu items that need to be linked to 10 anchors listed on the same page.

Anyone have any ideas as to how this is achieved using js?


May 9th, 2005, 09:44 PM
to go to an anchor ( <a> ) on the same page all you hve to do is for one, have anchors in the page and be sure to name them like so:
<a id=#anchor1></a>Anchor One
<a id=#anchor2></a>Anchor Two....ect

dont put the anchor text within the anchor, it will show up as a link. this way it shows up only as text but the anchor is still there.

and in the js all you have to do is assign the anchor id to window.location like so:

it will jump to that anchor within the page.

May 10th, 2005, 09:57 AM
Fantastic, that seems to work nicely, thanks a lot for your help.