Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Close menu on selection

Close menu on selection 31 May 2015 13:29 #27633

There is a fairly rough development instance at dev.visagateway.com.au/

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

Close menu on selection 31 May 2015 13:31 #27634

I know the code isn't triggering a click. At the moment just trying to identify the element I need to click to close.

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

Close menu on selection 01 Jun 2015 06:40 #27642

  • ced1870
  • ced1870's Avatar
  • Away
  • Administrateur
  • Administrateur
  • Posts: 19214
  • Karma: 411
  • Thank you received: 2461
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

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

Joomlack Webmaster and Developer

Close menu on selection 01 Jun 2015 11:10 #27648

Thanks so much for your help! The class is of course added dynamically and I didn't notice it. This works beautifully:

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.

Close menu on selection 01 Jun 2015 13:54 #27650

  • ced1870
  • ced1870's Avatar
  • Away
  • Administrateur
  • Administrateur
  • Posts: 19214
  • Karma: 411
  • Thank you received: 2461
happy to see it working :)

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

Joomlack Webmaster and Developer
  • Page:
  • 1
  • 2
Time to create page: 0.208 seconds

Fast and powerful creation, customizable and responsive.

Read More

Qui est en ligne

We have 185 guests and one member online