Answer the question
In order to leave comments, you need to log in
How to collapse downdrop-menu on click on menu item?
I know how to handle the click, but how to execute the closing (folding) itself is unknown.
Tried through .collapse, and also removed the show class, puts the attribute aria-expanded = 'false' - it doesn't work.
Thank you!
Shitcode:
https://codepen.io/webgospodin/pen/aQjPqP
Answer the question
In order to leave comments, you need to log in
https://codepen.io/anon/pen/RqebbW
remove hover styling for menu items
.dropdown-item:hover + .dropdown-menu,
.dropdown-menu:hover {
/*opacity: 1;
display: block;
transition: opacity .1s .1s;*/
}
$(a).click(function(){
$(".dropdown").removeClass("show");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question