Keep-bootstrap-3-dropdown-open-when-clicked

前端 未结 2 735
借酒劲吻你
借酒劲吻你 2021-01-25 23:36

I need help achieving the same navigation as below link.

It has my code along with clients requirement. And I\'m using Bootstrap 3

Bootstrap Dropdowns -          


        
2条回答
  •  再見小時候
    2021-01-26 00:13

    Not sure if its the right way but i did

    $(function(){
      $('.nav').find('li.dropdown.active').addClass('open');
      $(".dropdown").on("hide.bs.dropdown",function(e) {
            e.preventDefault(); 
            return false;
       });
      $('.navbar-main li').on('click', function (){
        var me = $(this);
        $('.navbar-main li').removeClass('open');
        $(this).addClass('open');
      });
    });
    

    and its working fine :)

提交回复
热议问题