Close menu on selection

Close menu on selection was created by johnoatwork

Posted 8 years 10 months ago #27464
Hi,

I'm using Maximenu with the pushdown theme and on click activation. The menu items make AJAX calls to display the pages.

Because the page doesn't reload the menu stays open after a selection is made. I need a way to auto close it.

I can put a few lines of code in the AJAX callback if this is the easiest way.

I would appreciate your advice on what this code should be.

Thanks

JM

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

Replied by ced1870 on topic Close menu on selection

Posted 8 years 10 months ago #27472
Hi
I have to make some tests by my side to check this, as this is the first time someone ask this. :)
Remind me on thursday, I will have a look
CEd

Joomlack Webmaster and Developer

by ced1870

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

Replied by johnoatwork on topic Close menu on selection

Posted 8 years 9 months ago #27612
OK thanks!

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

Replied by ced1870 on topic Close menu on selection

Posted 8 years 9 months ago #27624
looking again at your request I think that you can fire a click event on the link so that the menu will react and then close. You just have to point to the item that has the submenu opened. Is it clear ?

Joomlack Webmaster and Developer

by ced1870

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

Replied by johnoatwork on topic Close menu on selection

Posted 8 years 9 months ago #27625
I probably didn't phrase the question very well. Firing a click event on the active link should of course close the menu.

The difficulty I'm having is getting a reference to the active maximenuck link. My understanding is that Joomla adds the active class to the current menu item but a.active doesn't work. I can fire an event on all "a" links but I don't want to double click everything!

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

Replied by johnoatwork on topic Close menu on selection

Posted 8 years 9 months ago #27627
Actually I don't think it will work. If I click the link a second time it just reloads the page. It doesn't close the menu.

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

Time to create page: 0.733 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 978 guests and one member online