Button to Trigger Nav-Tab with Twitter Bootstrap

后端 未结 4 2089
遇见更好的自我
遇见更好的自我 2021-02-04 13:07

This button triggers the next tab to load content, but the tab itself does not switch, it remains on the first tab..


4条回答
  •  执念已碎
    2021-02-04 13:43

    It's quite simple with Bootstrap 4 & JQuery, i'm using this solution:

     $(document).ready(function(){
            activaTab('aaa');
        });
    
        function activaTab(tab){
            $('.tab-pane a[href="#' + tab + '"]').tab('show');
        };
    

提交回复
热议问题