One of my clients has expressed frustration with the fact that if your cursor slips off the menu, it immediately disappears and they must renavigate the entire menu. Is there any way to add a delay for how long the menu shows after the mouse is not over it? Sorry if this is a simple thing, I know very little programming. Thanks for any help!
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | nice_menus.module.txt | 5.53 KB | NealBussett |
| #18 | nice_menus.js__0.txt | 2.16 KB | NealBussett |
| #4 | nice_menus.js.txt | 1.52 KB | justsaynik |
Comments
Comment #1
jakeg commentedThe menu is intended to use as little javascript as possible, partly to keep it lightweight and partly because I know very little javascript! Adding such a feature would no doubt require javascript, if possible at all, so its not something I intend to add any time soon, though I understand your frustration as such a feature would be very useful.
Comment #2
a.k.karthikeyan commentedI too have faced the same problem. I tried to fiddle around using setTimeout on mouse over but no luck yet...appreciate if somebody would help..
Thanx
Comment #3
a.k.karthikeyan commentedAnybody doing this... i have been trying for the past week and i am not able to get this..... This is a critical feature for my project and my client is insisting on this... any help is deeply appreciated...
Comment #4
justsaynik commentedPlease find the attached file "nice_menu.js".
To achieve delay while hiding nice menus, Replace the file
modules->nice_menu->nice_menu.js with this file.
Note: The code is bit raw, but this serves the purpose.
Comment #5
jakeg commentedFantastic, thanks for your code. You mention its a little raw, so I won't add it to the module quite yet. I encourage people to try it out though and report back any problems or successes they have with it.
Comment #6
a.k.karthikeyan commentedHi
it works for the first level and from next level on its the same. I think the prevele id is not being tracked properly. I tried an alert on the prevele and saw that the prevele when when on child nodes fills up from child to parent on mouseout. that means the prevele has the parent ids of the element which we are trying to track..
Regards
Karthikeyan
Comment #7
theiviaxx commentedJS didn't work for me. It broke the menus in IE and FF had no change. I simply replaced the content of the old nice_menus.js file with the functions you supplied. Not sure if i was supposed to re-enable the module or what.
Comment #8
pjb commentedI have the same issue as theiviax; menus no longer worked in IE and FF had no delay. I was using this on the 4.7 version of the module however.
pjb
Comment #9
jakeg commentedPlease do let me know if anyone gets any further with this. Its a feature a lot of people would like to see. I'm eager to commit it if it can be made to work, but don't have any time/skill to develop the JS myself.
Can JQuery help for the 5.* implementation of the module?
Comment #10
jakeg commented...hoping to get rid of italic text here.
Comment #11
steveoliver commentedThis patch appears to make no difference in the functionality of my menus - hmmm... It'll be great when this works
Comment #12
hickory commentedSeeing as the module uses jQuery now, it should be much easier to have a delay on showing/hiding the menu, which would make it much more usable in my opinion.
PS. Could we have a DRUPAL-5 branch?
Comment #13
Anonymous (not verified) commentedWe would like to add a time delay to our nice menu as well. The website is http://www.qahc.org.au/
I have tried the patch that was posted earlier, but it doesn't work in Safari (Mac), Firefox (PC or Mac), and some versions of IE (PC). The latter might be due to our customised CSS menu styles.
Comment #14
cpelham commentedWe are also experiencing the same problem, although not every time. We are now running Drupal 5RC2 and otherwise all is mostly well. As noted elsewhere Nice Menus is not cooperating with itn18 (our site is bi-lingual English/Japanese). However, we recreated a second menu block in Japanese and switch back and forth. This was a little extra work but does the job just as well. For anyone who would like to take a look, our site is live at:
http://www.crsny.org
We really want to add the menu delay ASAP as some of our users have already said they've given up on trying to navigate down. I'll try to explore solutions myself, but my javascript and php are not very good, and I have a harder time modifying someone else's script than starting from scratch. Also, I know nothing about JQuery. Can anyone tell me if we should be looking to modify the Nice Menus .js file, or whether we should be doing something wth JQuery and/or iFrame (which I also know nothing about)?
Comment #15
Grinin commentedI'm about to put a gunshot through my screen... I've been trying all sorts of javascript tricks to get this thing to add some delay but to no avail.
Finally I commented out the following 2 lines:
liNodes[j].onmouseover=function() { addClass(this, 'over'),2000); }
liNodes[j].onmouseout=function() { removeClass(this, 'over'),2000);}
and the code still worked the same?! It doesn't make any sense to me... so I'm giving up for tonight.
Please somebody help find a solution to this. It is impossible to use the menu if there is no delay....
No delay = "Not Nice!"
Help!?
Chris
Comment #16
Grinin commentedAnybody home? Or should we begin work on a new version of Nice Menu's ourselves?
Comment #17
Anonymous (not verified) commentedI'm also getting quite some nasty feedback about users not being able to navigate our website because Nice Menus's sub-menus close too fast.
Any ideas how the code could be patched are greatly appreciated.
Or if anyone knows of an alternative module that does the same thing better... does Drupal v5 come with pop-up menus out of the box?
Comment #18
NealBussett commentedHere's a working (and tested in Safari, Firefox (Win & Ubuntu), Opera, and IE6) fix. Both files are drop-in replacements for their counterparts.
Two parts. This is the JS component.
Comment #19
NealBussett commentedSecond Part: the module.
Comment #20
amanire commentedJust as an FYI, the fix that NealBussett posted crashes Drupal 5 with an undefined call to theme_add_style.
Comment #21
add1sun commentedYeah, 4.7 module code doesn't work in 5. That said new features will only go into 5 now so I'm moving this to 5 dev and we will need newer code that uses jquery.
The larger question is if we make nice menus be totally dependent on js that changes the underlying concept a bit (some people really want css only menus). There is no *general* js *dropdown* menu module for drupal yet. Simplemenu is for only one menu and it gets stuck to the top of the screen (normally intended for the main navigation menu) and DHTML menu is not for dropdown/flyout but for expand/contract.
So, if nice menus moves to js do we still support a css-only version as well for folks that still want that? Another question is, is it at all feasible to join forces with the DHTML module and create one module that lets you do multiple kinds of js menus?
Thoughts on this are welcome.
Comment #22
AdrianB commentedIf it's not too much trouble I'd say keep the css-only menu and make it an option (default or not default). Right now we have a fully working css-only menu (used for standard-compliant browsers) and a fully working js menu (used for IE), so most of the work is already done as far as I can see. When I switch to the [hacked] jquery version of Nice Menus I noticed the sliding effect and I guess some people would like to add such effects (and others) to all browsers. If there was a setting for this ("always use js menu") I think that would please these people.
Comment #23
Jomel commentedCouldn't you keep a basic CSS implementation, then use JS to improve/override it if available?
Comment #24
AdrianB commentedI think there are those who prefer the css-only menu even if javascript is available.
Comment #25
neurojavi commentedHi:
Great modelule! Thanks!
The patch form NealBussett is for 4.7 or for 5.x?
I've tested in drupal 5.1 with firefox and see no changes with the default behavior.
Can I try something to get taht delay in 5.x?
Many thanks.-
PD: I agree with previous post: Without this feature the menus are a little difficult to use.
Javi.-
Comment #26
add1sun commentedI would guess that the patch was against 4.7 since that was the version on the issue before I just changed it. If a new feature like this goes in though, it will only go into HEAD or into a new 5.x-2 version since it is a significant new feature. We need to get a 5.x-1 stable release out the door right now. I don't have time to work on this but if anyone wants to write a patch that uses jquery and against the newer code I'll be glad to review. I would say also that pursuant to this thread it would need to be an option that folks can choose to use the css-only or full-js version on the settings page.
Comment #27
emdalton commentedMy users want this as well (on Drupal 5.1). The behavior on Firefox is actually pretty good, but IE is awful. I looked at the javascript (since that's what controls IE) and then googled around for ideas on how to use jquery to do this. http://www.learningjquery.com/2007/01/effect-delay-trick suggested adding
.animate({opacity: 1.0}, 3000)Since the opacity is already at full, apparently this just causes a delay.
I tinkered with this a bit and ended up modifying the hide line to look like this:
$(this).animate({opacity: 1.0}, 1000).find("> ul").hide().removeClass("over");It's still a bit flaky, and sometimes there's a delay in showing a menu dropdown because it's still thinking about the previous menu choice, but it's better than it was. Someone who really understands how jquery works could probably do better, but I'll use this for now.
Comment #28
emdalton commentedI switched to Lucid Menu and my users are much happier now. Just thought I'd share that. (Nice Menus looks great in Firefox, but the IE behavior was driving people crazy.)
Comment #29
add1sun commentedyeah, I think with Lucid menu out now, if folks want a JS-only menu they should go that route. Nice menus can remain focused on CSS menus. Unfortunately the problem with JS-only is the lack of graceful degradation for folks without javascript.
I'm going to mark this won't fix unless someone really wants to figure out a "good" way to do this within nice_menus.