Answers for "bootstrap stop dropdown from closing when button is pressed"

-1

bootstrap prevent dropdown from closing on click

// If an element inside a dropdown menu has the "keep-open" class,
// disable closing the dropdown menu.
$(document).on('click.bs.dropdown.data-api', '.keep-open', function (e) {
  e.stopPropagation();
});
Posted by: Guest on October-01-2020
0

bootstrap 3 dropdown don't close on click

$('li.dropdown.mega-dropdown a').on('click', function (event) {
    $(this).parent().toggleClass('open');
});
Posted by: Guest on June-10-2021

Code answers related to "bootstrap stop dropdown from closing when button is pressed"

Code answers related to "Javascript"

Browse Popular Code Answers by Language