Close menu on selection

More
9 years 10 months ago #27642 by ced1870
Replied by ced1870 on topic Close menu on selection
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

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

More
9 years 10 months ago #27648 by johnoatwork
Replied by johnoatwork on topic Close menu on selection
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.

More
9 years 10 months ago #27650 by ced1870
Replied by ced1870 on topic Close menu on selection
happy to see it working :)

Joomlack Webmaster and Developer

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

Time to create page: 0.210 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 813 guests and one member online