tommcfarlin / Collapsible-Menus

[Retired-jQuery] Collapsible Menus is a plugin that makes it easy to create collapsible menus using nested, unordered lists.
http://tommcfarlin.com/collapsible-menus/
20 stars 13 forks source link

Menu slide is triggered on double click NOT single click #1

Closed encantador-coder closed 12 years ago

encantador-coder commented 12 years ago

Hi Tom,

First of all, thanks for the great plugin. It is simple and cool.

There is a slight issue. The menu slide is only triggered on double click when it should be triggered on double click.

Any suggestions on what might be the issue. Thanks!

Kind Regards, Nitin

tommcfarlin commented 12 years ago

How do you have the menu setup? If you look at the demo, you'll see that you only have to single click on the trigger.

Let me know how you've got it setup and I'll take a look!

encantador-coder commented 12 years ago

Hi,

Please have a look at it here - http://www.easybabyaustralia.com.au/shop/ - The category menu on the left. You can have a look at your JS here - http://www.easybabyaustralia.com.au/wp-content/themes/easy-baby/js/

I have tried with a href=# and with javascript:void but it simply won't work with single click. Please advise. Thanks!

Kind Regards, Nitin

tommcfarlin commented 12 years ago

This is because you're applying the collapsible menus to an unordered list using anchors - since the text is the child of the anchor and the anchor is the child of the list item so the clicking event doesn't propagate properly.

The first option I'd recommend is removing the anchor from the <li> and just use text.

encantador-coder commented 12 years ago

Thanks for your reply.

I did that earlier, did not work. I will do it now again. Hang on!

encantador-coder commented 12 years ago

Done. Still the first click does not register. I have noticed a weird thing. Once I double click to open an item, from then on single click works.

encantador-coder commented 12 years ago

So it is the first time around that each parent item requires double click. Then onwards, single click works. Please have a look.

Kind Regards, Nitin

encantador-coder commented 12 years ago

Hi Tom,

Thanks for all your help. Your advice was spot on. I removed the anchor and a piece of code I added earlier to make it work with anchors, and now it is working like a charm.

Thank you again for your wonderful plugin.

Kind Regards, Nitin

tommcfarlin commented 12 years ago

Great!