Bootstrap linking to a tab with an url

前端 未结 3 536
旧时难觅i
旧时难觅i 2020-12-03 09:01

I am working with bootstrap 3, and I am having some problems on linking a url to a specific tab, the panel changes but the activated tab doesnt. So I want the line <

3条回答
  •  离开以前
    2020-12-03 09:12

    In order to activate the tab you can use jQuery plugin as shown in bootstrap. So you can add this piece of jQuery code to your program to enable the tab:

    $(function () {
        $('#tab1 a').click(function (e) {
            e.preventDefault();
            $('a[href="' + $(this).attr('href') + '"]').tab('show');
        })
    });
    

    You can check this link: Updated code

提交回复
热议问题