I have a Bootstrap Tab tab with three content tabs. It works great, except that I want to associate one of the tabs with the INTERNAL navigation on the tab. This means that when someone clicks a link outside the tab window, it should set this tab to “active” and show the contents.
At the moment, it correctly displays the contents of this tab, but the tab is not set to “active”. How can I achieve this so that it is “active”, as if someone clicked?
Here is the code:
<div> <ul class="nav nav-tabs"> <li class="active"><a href="#home" data-toggle="tab">Home</a></li> <li><a href="#profile" data-toggle="tab">Profile</a></li> <li><a href="#messages" data-toggle="tab">Messages</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="home">Home Content</div> <div class="tab-pane" id="profile">Profile Content</div> <div class="tab-pane" id="messages">Messages Content</div> </div> </div> <p></p> <a href="#profile" data-toggle="tab">Profile Link From Outside</a>
I made jsFiddle to show it better: http://jsfiddle.net/fLJ9E/
Thanks so much for any help or tips :)
jquery css twitter-bootstrap tabs
user1227914
source share