I have a structure of tabs with 3 levels:
<!-- Nav tabs - First level -->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li>
<li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li>
</ul>
<!-- Tab panes - First level -->
<div class="tab-content">
<div class="tab-pane active" id="home">
<p>Home content.</p>
<!-- Nav tabs - Second level -->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#home2" role="tab" data-toggle="tab">Home 2</a></li>
<li><a href="#profile2" role="tab" data-toggle="tab">Profile 2</a></li>
</ul>
<!-- Tab panes - Second level -->
<div class="tab-content">
<div class="tab-pane active" id="home2">
<p>Home 2 content.</p>
<!-- Nav tabs - Third level -->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#home3-1" role="tab" data-toggle="tab">Home 3-1</a></li>
<li><a href="#profile3-1" role="tab" data-toggle="tab">Profile 3-1</a></li>
</ul>
<!-- Tab panes - Third level -->
<div class="tab-content">
<div class="tab-pane active" id="home3-1"><p>Home 3-1 content.</p></div>
<div class="tab-pane" id="profile3-1"><p>Profile 3-1 content.</p></div>
</div>
</div>
<div class="tab-pane" id="profile2">
<p>Profile 2 content.</p>
<!-- Nav tabs - Third level -->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#home3-2" role="tab" data-toggle="tab">Home 3-2</a></li>
<li><a href="#profile3-2" role="tab" data-toggle="tab">Profile 3-2</a></li>
</ul>
<!-- Tab panes - Third level -->
<div class="tab-content">
<div class="tab-pane active" id="home3-2"><p>Home 3-2 content.</p></div>
<div class="tab-pane" id="profile3-2"><p>Profile 3-2 content.</p></div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="profile">Profile content.</div>
</div>
This code could be checked here: (http://jsfiddle.net/bvta2/3/).
When you access the link http://fiddle.jshell.net/bvta2/3/show/#profile3-1, the Profile 3-1 tab appears active. However, when accessing http://fiddle.jshell.net/bvta2/3/show/#home3-2, for example, the Home 3-2 tab is not active.
How can I solve this using jQuery? Thanks!