View Full Version : how to inhibit hvmenu navigation when submenus are present?

06-28-2007, 05:32 PM
1) Script Title: HV Menu v5.5

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

3) Describe problem: When a base menu item has submenus, I need to disable the link at the base. For example, in the demo menu on the code page (above link) NEWS has two submenus (and little right arrows), so you do not want a link at NEWS, since no one expects to have a content link there. So, I need to modify the code to not link to anything if the menu item has submenus. I believe this is something that almost everyone would want. Does anyone see an easy way to do this? Can't have a 'page not found'.....and I do because I'm using it right now. Thanks in advance.

06-28-2007, 08:37 PM
So you are saying that on the root menu you do not want it linked to a file?
A simple way is to make the URL either "#" or "?", or you could make the URL "javascript: var x=null;" etc. With all of these, nothing will happen when you click the link. Otherwise, you will have to re-write part of the script and remove the anchor tags from those root menu items.

06-29-2007, 12:28 PM
Used the '#' and it worked perfectly. Thanks a lot. Suppose that this trick should be posted to the script link so others can find it.

Personally, I like the menu the was it is, but I'm doing a site for someone that finds the root menu is never (or infrequently) accessed, so I assume that it is uncommon for other menus to link the way hvmenu does.

06-29-2007, 06:49 PM
Any time. I think they take it for granted that not all people know about the "#" trick.

Most menus DO allow the root menu to have a link, though I agree that most people never use it.