tags:

views:

61

answers:

1

Hi, Is there a way to display the dropdown menu shown on sitepoint by mouse click. http://www.sitepoint.com/blogs/2009/03/31/make-a-mega-drop-down-menu-with-jquery/

Currently, it shows the menu only on mouse hover.

A: 

You can add to this:

$("li.mega").hoverIntent(megaConfig); 

And make it this:

$("li.mega").hoverIntent(megaConfig).click(addMega);

Depending on how you want it to behave (you can test, see which seems more natural), you may want this instead:

$("li.mega").hoverIntent(megaConfig).click(function() {
  $(this).toggleClass("hovering");
});

If you only want it shown on mouse click, remove the .hoverIntent(megaConfig) part from that last example, leaving only the .click() part.

Nick Craver