Close menu on selection
9 years 10 months ago #27642
by ced1870
Joomlack Webmaster and Developer
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

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.
- johnoatwork
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 0
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:
The 150ms delay just smooths the transition out a bit. Great!!
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.
9 years 10 months ago #27650
by ced1870
Joomlack Webmaster and Developer
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