开发者

Mega dropdown menu

I'm using a Mega Dropdown menu, when I click an option, the href tag is executed but the menu is kept open. I am forced to move the mouse away from the menu to close it. How can I close the menu after a user click or Selection. This is a menu based on pure CSS. I think I am missing some jQuery or JavaScript to tak开发者_C百科e care of the event. Would you help?


Right after using your jsfiddle code I think you'll need to use some jQuery along these lines:

$("ul.greybox").find("a").each(function() {
    //$(this).attr("href", "#"); Just for testing
    $(this).click(function() {$(".dropdown_3columns").attr('style', 'display:none');});
});

This basically, sets the style of the dropdown div .dropdown_3columns to display:none when the user clicks on one of the items in that dropdown.

Check it working here - http://jsfiddle.net/RpfYa/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜