Results 1 to 8 of 8

Thread: Submenu disappears on click in All Levels Menu

  1. #1
    Join Date
    Nov 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Submenu disappears on click in All Levels Menu

    1) Script Title: All Levels Navigational Menu (v3.1)

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

    3) Describe problem:

    I upgraded to v3.1 of the All Levels Navigational Menu but when users click on a menu item any related drop-down/fly-out submenu container is cleared but not closed. This is not the expected behavior. Users expect either a page to open (for real links) or the drop-down/fly-out menu to stay open (for href="#"). This is essentially the issue discussed in this V2.x tread: http://www.dynamicdrive.com/forums/s...ad.php?t=60067.

    I changed the code in my implementation of V3.1 to include the hack discussed in the thread mentioned above from:
    Code:
    ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
    to:
    Code:
    ddlevelsmenu.showmenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
    That corrected the behavior at the main menu level but not at the submenu level(s). Can you suggest a hack for the submenu problem?

    I was surprised that you didn't include this fix when you updated to V3.1. Was there some particular reason you didn't?

    Thanks for you efforts. I love your site and use it often.
    Last edited by LenInAtlanta; 11-04-2011 at 02:40 PM. Reason: Clarify menu in question

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If I understand the "issue" correctly, are you talking about how when a main menu item is clicked on, the associated drop down menu appears "empty" shoud the user press the "back" button to revisit the menu page from the destination page? From what I can tell this only occurs if the mouse hasn't moved away from the menu item in question between the visiting the destination page and then returning again. So it seems to be an issue that occurs under this specific circumstance.

    The change you mentioned above simply forces the drop down menu to not disappear when the parent menu item is clicked on. If you're ok with that and wish to extend this behavior to sub menu items as well, try finding the below line inside the script:

    Code:
    this.addEvent(shelldiv, function(){ddlevelsmenu.hidemenu(this)}, "click")
    and change it to:

    Code:
    this.addEvent(shelldiv, function(){ddlevelsmenu.showmenu(this)}, "click")
    IMO this isn't a serious bug (both due to the circumstances required for it to occur, and also that it appears to be a browser rendering issue, not so much script logic), hence I haven't really thought about addressing it officially.
    DD Admin

  3. #3
    Join Date
    Nov 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    First let me say how much I appreciate your services. I'm really impressed that you can keep up with everything! Second, your suggested hack works perfectly. Thank you.

    Now to explain better what I see as confusing. If you change the Web Tools link in your demo.htm from
    Code:
    href="http://tools.dynamicdrive.com/"
    to
    Code:
    href="#"
    and then click on the Web Tools link, you'll see the contents of the dropdown menu disappear - the container will still be there but it'll be empty, thus un-clickable. This happens in the 7 browsers I test in.

    Thanks again for your great scripts and service.

  4. #4
    Join Date
    Oct 2010
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by LenInAtlanta View Post
    First let me say how much I appreciate your services. I'm really impressed that you can keep up with everything! Second, your suggested hack works perfectly. Thank you.

    Now to explain better what I see as confusing. If you change the Web Tools link in your demo.htm from
    Code:
    href="http://tools.dynamicdrive.com/"
    to
    Code:
    href="#"
    and then click on the Web Tools link, you'll see the contents of the dropdown menu disappear - the container will still be there but it'll be empty, thus un-clickable. This happens in the 7 browsers I test in.

    Thanks again for your great scripts and service.
    Hi,
    I have exactle this issue.
    How did you over come the problem?

    Thanks

  5. #5
    Join Date
    Nov 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This was a while ago, so I don't remember for sure. But, try this:

    Look for:
    Code:
    ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
    and replace it with:
    Code:
    ddlevelsmenu.showmenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
    and look for:
    Code:
    this.addEvent(shelldiv, function(){ddlevelsmenu.hidemenu(this)}, "click")
    and replace it with:
    Code:
    this.addEvent(shelldiv, function(){ddlevelsmenu.showmenu(this)}, "click")
    Please report back if this solves your issue so others who follow our footsteps will know if this works.

  6. #6
    Join Date
    Oct 2010
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by LenInAtlanta View Post
    This was a while ago, so I don't remember for sure. But, try this:

    Look for:
    Code:
    ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
    and replace it with:
    Code:
    ddlevelsmenu.showmenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
    and look for:
    Code:
    this.addEvent(shelldiv, function(){ddlevelsmenu.hidemenu(this)}, "click")
    and replace it with:
    Code:
    this.addEvent(shelldiv, function(){ddlevelsmenu.showmenu(this)}, "click")
    Please report back if this solves your issue so others who follow our footsteps will know if this works.
    Hi,
    I digged a little dipper yestarday and also found that solution.
    Thanks so much for your reply.

    I have the problem fixed now.

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script has just been updated for said bug (and a couple of others). Please revisit the script page and download the latest .js file.
    DD Admin

  8. #8
    Join Date
    Oct 2010
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    The script has just been updated for said bug (and a couple of others). Please revisit the script page and download the latest .js file.
    Thanks for the update.
    Even bigger thank you for the script

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
  •