开发者

Mega Dropdown menu seen on sitepoint: How do I show the menu on mouse click

Is there a way to display the dr开发者_C百科opdown 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜