Close menu on click outside of menu area

More
9 years 3 months ago #29243 by cme
Hi,

I am using Accordeon Menu CK for my main navigation. The event to open is set to "click" in order to support touch devices. Everything is running fine, but I would really like to close the menu if the user clicks anywhere outside of the menu and not just if the user clicks on the top level item again. Any hints? I couldn't find anything in the manual.

Best regards
cme

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #29248 by ced1870
Hi
I have already tried to implement this feature, but without success...
Remind me next week, I will give it a new try :)
CEd

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #29381 by cme
Hi CEd,

friendly reminder, any progress? ;)

cme

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #29442 by ced1870
Hi
no progress for now ... :(
I'm on a development that takes a lot of brain faculties ;) and many people are back from holidays.
I note your request on my todolist, and I will let you know when I will be able to have a look at this
CEd

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #29944 by cme
Hi CEd,

Guess you are still pretty busy. What do you think about an approach like this:
Code:
$( "body" ).click(function( event ) { if(!event.target.hasClass("toggler")){ accordeonmenuInit(); }

All of your menu elements contain the class "toggler". If the user clicks on one of those, nothing happens. If any other element is clicked, would it be possible to simply reinitialize the whole menu?

If not, one could check, if any of your li items contain the "open" class and invoke your "togglemenu" function for that.

Let me know what you think.

cme

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #29948 by ced1870
Hi
yes I'm quite busy :)
you can try to fire the click event like this
Code:
$('li.accordeonck.open').trigger('click');
(not tested by my side)
CEd

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.201 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 1005 guests and no members online