View Full Version : Smooth Menu Click/Shadow probs.

Cody J
01-21-2009, 09:28 PM
1) Script Title: DD Smooth Navigational Menu

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

3) Describe problem: Okay, I did indeed do a forum search and came across a few topics on the problems I've been having, with no positive results. :(

Basically I want the sub-menu to open on click, & close onclick, and close previously opened sub menus, if a different item is clicked. ( I do not have any secondary sub menu's).

At first I tried the method this guy posted, and I couldn't get any of the sub-menus to close. Down the line I eventually figured you can just change 'hover' to 'click' and get the same affect. But still, none of them will close.
This is my issue, having the menu's close, onclick. Whether it be the same menu, or a different one.

Second issue is the shadow, even with the updated script (dec. 12) in Internet Explorer it leaves a box under the navigation after it has been closed (given I did the hover method, cause I can't get the click working).. I've read previous threads that this has been fixed, but it's not working for me?

Thanks in advance :)

01-22-2009, 12:45 AM
Well, getting the sub menu to disappear onclick is fairly easy. As mentioned in this thread (http://www.dynamicdrive.com/forums/showthread.php?p=177431), just add the code in red below the existing line in black:

$mainmenu.find("ul").css({display:'none', visibility:'visible'})
$mainmenu.find("ul").css({display:'none', visibility:'visible'}).click(function(e){
$(this).animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)

As far as getting the entire menu to react onclick (instead of onhover), there are subtle issues that make this more time consuming to do. I haven't tried Snookerman's mod (http://www.dynamicdrive.com/forums/showthread.php?t=40170) yet, but this is probably something I can only consider doing the next time I update this script. For the time being if you're willing to use All Levels Menu instead, there is a mod for that which makes it react onClick: http://www.dynamicdrive.com/forums/showthread.php?t=40787

I'm aware of the shadow issue, which unfortunately is still there in IE6 (but not IE7). Until I can find a solution, one obvious workaround is just to disable the shadow effect.

Cody J
01-26-2009, 11:57 PM
I did as you said and it works when I click to open the first sub-menu. But if I click the same category it doesn't close the menu, or if I click a different category it doesn't close the previously opened menu.

I tried Snookerman's mod and I get the same results. The menu just will not close onclick. :(

Cody J
01-27-2009, 12:03 AM
Actually after having looked over Snookerman's mod I actually got the script to work.

The menu opens, onclick.
The menu closes, onclick.

Then the menu happens to re-open, I have no idea whyyy. :(

As far as getting the entire menu to react onclick

I only want the first initial item (the category item) to be clickable, to where it opens and closes the menu.. from there sub-folders, sub-menu's can all stay with the onhover.