How to open specific tab of bootstrap nav tabs on click of a particuler link using jQuery?

前端 未结 8 2116
Happy的楠姐
Happy的楠姐 2020-11-29 01:32

I am new to jquery and bootstrap,so please consider my mistakes.I have created a bootstrap modal for login and registration. It contains two nav-tabs called as login and reg

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 02:14

    Thanks for above answer , here is my jQuery code that is working now:

          $(".header-login-li").click(function(){
            activaTab('pane_login');                
          });
    
          $(".header-register-li").click(function(){
            activaTab('pane_reg');
            $("#reg_log_modal_header_text").css()
          });
    
          function activaTab(tab){
            $('.nav-tabs a[href="#' + tab + '"]').tab('show');
          };
    

提交回复
热议问题