Results 1 to 5 of 5

Thread: Clicking on top link in JS dropdown menu doesn't work??

  1. #1
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Clicking on top link in JS dropdown menu doesn't work??

    1) Script Title: AnyLink Drop Down Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.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?

    Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    onClick="return clickreturnvalue()"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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/dynamici...kvertical.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.).
    Last edited by ksingh; 08-07-2006 at 03:32 PM.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Heh, fine tuner. That's probably me. What can i say, i like things just right.

    thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •