Forums

This topic is locked

jump menu can't link to named anchors??

Posted 19 Jun 2005 00:54:59
1
has voted
19 Jun 2005 00:54:59 Jason Mr. posted:
Hi guys,

I need to make a jumpmenu (or list, doesn't matter) contain links to named anchors within the same page. I am having a helluvuh time trying to get this to work, and am loosing faith it can be done. So simple, but so impossible.

The following code concept does not work:
<form name="form1">
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<option value="#link01">link 1</option>
<option value="#link02">link 2</option>
<option value="#link03">link 3</option>
<option value="#link04">link 4</option>
</select>
</form>

Is it something to do with the javascript line? Or is it that <option> values can't link to <a href> values (used for named anchors)?

Replies

Replied 26 Jun 2005 06:47:44
26 Jun 2005 06:47:44 Nikkisha Barnard replied:
Being that this is a dreamweaver forum I'm assuming you have it. I don't know if this is exactly what you want but here's a round about solution.

You can have words, questions, menu topics, etc.. at the top that leads the user to wherever you want them to jump on the page. You put a name anchor at the top and you could name it top. You do this in dreamweaver by going to the insert ->Named Anchor and naming the anchor top.

Then where ever the words,questions,menu topics, etc... is suppose to link you to on the same page you put named anchors there as well.

Then you turn those words, questions, menu topics, etc... into links and their links will read #name of anchor and that's how the jump menu could work.

If you ge confused as to what I'm saying go to the help menu in dreamweaver ->using dreamweaver and in the search menu type jump menu and go to selection jump menu and it will have throughal instructions on how to develop one.

Now the links you have on the top you make them

NB
#1 Player
Replied 01 Jul 2005 05:02:37
01 Jul 2005 05:02:37 Jason Mr. replied:
Yeah, I already had all that going on. Thanks for the post though, I do appreciate your help. I finally figured it out. I couldn't use named anchors with text links because of the way the page needed to work (page design constraints), so I figured out how to make the jump menus link to same page anchors. Now they can just use the drop down lists which fit much better. In case anyone else needs the code to make this work, here's some copied out of one of my pages. Just augment for your needs. If you have more than one menu per page, they need to be numbered differently (ie jump2, menu2, etc...).

<form name="jump1">
<tr>
<td><a name="link01"></a>Alpha-agonists</td>
<td>
<select name="menu1">
<option value="#topofpage" selected>back to top</option>
<option value="#link01">Alpha-agonists</option>
<option value="#link02">CA Inhibitors</option>
<option value="#link03">Combo Therapies</option>
<option value="#link04">Docosanoids</option>
<option value="#link05">Miotics</option>
<option value="#link06">Non-selective BB's</option>
<option value="#link07">Prostaglandins</option>
<option value="#link08">Selective BB's</option>
</select>
<input type="button" onClick="location=document.jump1.menu1.options document.jump1.menu1.selectedIndex].value;" value="GO">
</td>
</tr>
</form>

Jason

Reply to this topic