Close menu on click outside of menu area
9 years 3 months ago #29243
by cme
Close menu on click outside of menu area was created 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
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.
9 years 3 months ago #29248
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Close menu on click outside of menu area
Hi
I have already tried to implement this feature, but without success...
Remind me next week, I will give it a new try
CEd
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.
9 years 2 months ago #29381
by cme
Replied by cme on topic Close menu on click outside of menu area
Hi CEd,
friendly reminder, any progress?
cme
friendly reminder, any progress?
cme
Please Log in or Create an account to join the conversation.
9 years 2 months ago #29442
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Close menu on click outside of menu area
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
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.
9 years 1 month ago #29944
by cme
Replied by cme on topic Close menu on click outside of menu area
Hi CEd,
Guess you are still pretty busy. What do you think about an approach like this:
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
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.
9 years 1 month ago #29948
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Close menu on click outside of menu area
Hi
yes I'm quite busy
you can try to fire the click event like this
(not tested by my side)
CEd
yes I'm quite busy
you can try to fire the click event like this
Code:
$('li.accordeonck.open').trigger('click');
CEd
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
Time to create page: 0.201 seconds