This was asked quite a few times before, but I can't find a proper solution yet. I am toggling navbar dropdown menus on hover with the following code:
$(".nav .dropdown").hover(function() {
$(this).find(".dropdown-toggle").dropdown("toggle");
});
which works just fine. However, clicking on the .dropdown-toggle button toggles the menu as well, which I want to avoid. Any suggestions on the code?
$('.dropdown-toggle').on('click',function(e){ e.preventDefault()});