Externally Linking to a Tab, Tab not changing, Bootstrap 3.3.5

后端 未结 3 717
南方客
南方客 2021-01-15 21:45

My issue is very similar to these questions, where I am trying to use a link to change tabs, but the link only changes the tab content, but not the active tab.

Most

3条回答
  •  执笔经年
    2021-01-15 21:58

    You could use window.location.href to get something like http://domain.com/index.html#tab1

    (not tested) but you could put:

    if (window.location.href.replace("#", "") == "tab1")
    {
      //change tab
    }
    

提交回复
热议问题