View Full Version : Clicking on top link in JS dropdown menu doesn't work??

08-04-2006, 02:55 PM
1) Script Title: AnyLink Drop Down Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: I loved the versatility of this dropdown menu and proceeded to style it to fit in my company's site. Only afterwards did I notice that clicking on the topmost link (the one which you have to mouseover to make the menu drop down) fails to work. The link is there... but the browser doesn't respond to clicking it. I've tried inserting the code into a clean page, no go. Interestingly, even the demo on the Dynamic Drive script page doesn't work in that sense. The links are set to "default.htm", but clicking doesn't make anything happen.

Ideas, anyone?


08-05-2006, 07:03 AM
That's how it is designed to work. Interestingly, if javascript is disabled, there will be no drop downs but, the links will work! The idea being that the link should be to a page with ordinary links on it to the content linked to via the drop down. That way, both javascript and non-javascript enabled browsers can navigate your site. However, there are other ways to achieve this and, if for whatever reason you want to change this behavior, remove this:

onClick="return clickreturnvalue()"

08-07-2006, 01:26 PM
Understood. Thanks for the response and added information.

I've found an interesting thing, however, that everyone may wish to note. If you remove this onClick:

onClick="return clickreturnvalue()"

then the menu works in the manner I originally thought it would (top links work). I found this out by comparing the script to that found in a similar menu called AnyLink Vertical Menu (http://www.dynamicdrive.com/dynamicindex1/anylinkvertical.htm). That script does not have this onClick in the A HREF. I removed it from the original script, and it works fine. I had suspected that the script was meant to have the top link work, since there's a URL included (default.htm, etc.).

08-07-2006, 08:35 PM
That menu can be set up either way as well. It is rather a simple matter in javascript to disable a link if desired.

Most people using either menu seem satisfied with the way it works. We only get the 'fine tuners', 'kooks', and 'clueless' in here. I think you are a 'fine tuner'. Nothing wrong with that, I'm one too.

08-07-2006, 08:47 PM
Heh, fine tuner. That's probably me. What can i say, i like things just right.