adamnurdin01 / bootsnav

Bootsnav - Multi Purpose Header
MIT License
171 stars 122 forks source link

Cart Dropdown Menu #2

Open Fethr opened 8 years ago

Fethr commented 8 years ago

I first want to say, great job with the Bootstrap Navbar! I want to display the cart dropdown on click instead of hover, and can't find the function that makes this happen. Is their a way to display just the cart dropdown on click instead of hover leaving all other menu dropdowns to display on hover?

adamnurdin01 commented 8 years ago

Just for sugestion.

you can give some class to cart dropdown, and disable "mouseenter" on this class,. like this

$("nav.navbar").each(function(){ $("li.dropdown.someClass", this).off("mouseenter"); $("li.dropdown.someClass", this).off("mouseleave"); $("li.dropdown.someClass > a.dropdown-toggle", this).on("click", function(e){ e.preventDefault(); $(this).closest("li.dropdown").find(".dropdown-menu").stop().fadeIn(); }); $("ul.nav", this).on("mouseleave", function(){ $("li.dropdown", this).find(".dropdown-menu").stop().fadeOut(); }); });

Hope this can help you... :)