tommcfarlin/Collapsible-Menus

Menu slide is triggered on double click NOT single click

Closed this issue · 8 comments

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

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!

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

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.

Thanks for your reply.

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

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.

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

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

Great!