I've just build a dropdown menu which I would like to drop down on a click, and go back up after an other click. This perfectly works with a toggle I have used, but the problem is that after the dropdown, the links don't execute.
$(function() {
$("#nav_menu-2 ul.menu ul").css({ display: 'none' });
$("#nav_menu-2 ul.menu #testbutton").toggle(function() {
$(this).find('ul.sub-menu')
.stop(true, true).delay(50).animate({ "height": "show", "opacity": "show" }, 300 );
}, function(){
$(this).find('ul.sub-menu')
.stop(true, true).delay(50).animate({ "height": "hide", "opacity": "hide" }, 300 );
});
});
So my geuss is that after the menu has dropped, it goes back up on a click, instead of executing the link. But since I'm quite new to javascript/jQuery, I have no idea what other option I have. Any ideas?