Close menu on selection

Replied by ced1870 on topic Close menu on selection

Posted 8 years 10 months ago #27642
using Firebug you can see that the element that is clicked receive a css class "clickedck" :)
you can then use this class to target the element where to fire the click event to close the menu

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 10 months ago #27648
Thanks so much for your help! The class is of course added dynamically and I didn't notice it. This works beautifully:

Code:
jQuery(document).ready(function(){ jQuery(document).on("click", "a", function() { var linkClass = jQuery(this).attr("class"); if (linkClass = "maximenuck") { setTimeout(function() { jQuery(".clickedck .titreck").trigger("click"); }, 150); } }); });

The 150ms delay just smooths the transition out a bit. Great!!

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 #27650
happy to see it working :)

Joomlack Webmaster and Developer

by ced1870

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

Time to create page: 0.657 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 781 guests and one member online