PDA

View Full Version : Submenu disappears on click in All Levels Menu



LenInAtlanta
11-04-2011, 12:24 PM
1) Script Title: All Levels Navigational Menu (v3.1)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/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/showthread.php?t=60067.

I changed the code in my implementation of V3.1 to include the hack discussed in the thread mentioned above from:

ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
to:

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.

ddadmin
11-04-2011, 04:35 PM
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:


this.addEvent(shelldiv, function(){ddlevelsmenu.hidemenu(this)}, "click")

and change it to:


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.

LenInAtlanta
11-05-2011, 09:57 AM
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
href="http://tools.dynamicdrive.com/" to
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.

tolinho
02-29-2012, 03:09 PM
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
href="http://tools.dynamicdrive.com/" to
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

LenInAtlanta
02-29-2012, 06:10 PM
This was a while ago, so I don't remember for sure. But, try this:

Look for:

ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])

and replace it with:

ddlevelsmenu.showmenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])

and look for:

this.addEvent(shelldiv, function(){ddlevelsmenu.hidemenu(this)}, "click")

and replace it with:

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.

tolinho
03-01-2012, 09:18 AM
This was a while ago, so I don't remember for sure. But, try this:

Look for:

ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])

and replace it with:

ddlevelsmenu.showmenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])

and look for:

this.addEvent(shelldiv, function(){ddlevelsmenu.hidemenu(this)}, "click")

and replace it with:

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.

ddadmin
03-02-2012, 05:32 AM
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.

tolinho
03-02-2012, 02:23 PM
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 :)