html - Twitter Bootstrap tabs not hiding content -
i have little problem code. tabs load when click on inactive tab doesn't hide content of first tab , displays content of both tabs. there can do? thank much!
<ul style="list-style:none"class="available-tabs nav nav-tabs" id="tabs" data-tabs="tabs"> <li class="active"> <a data-toggle="tab" href="#featured-tab-body">featured projects</a></li> <li> <a data-toggle="tab" href="#available-latest-tab">latest projects </a> </li> </ul> <div class="available-content tab-content container"> <div id="available-featured-tab"> <div class="featured-list-wrapper"> <div class="row"> <div class="col-md-12"> <div class="featured-list-content"> <div class="row featured-tab-head" style="color:black;height:40px"> <div class="col-md-5 col-sm-5 col-xs-8"> <h5> yae</h5> </div> <div class="col-md-2 col-sm-2 hidden-xs"> <h5>nah</h5> </div> <div class="col-md-2 hidden-sm hidden-xs"> <h5>hey</h5> </div> <div class="col-md-1 col-sm-2 hidden-xs"> <h5>you</h5> </div> </div> <div class="featured-tab-body tab-pane fade in active"> sup </div> </div> </div> </div> </div> <div id="available-latest-tab" class="tab-pane fade"> hi </div> </div>
you need put div contents under same root div. istead of:
<div class="available-content tab-content container"> <div id="available-featured-tab"> <div class="featured-list-wrapper"> <div class="row"> <div class="col-md-12"> <div class="featured-list-content"> <div class="featured-tab-body tab-pane fade in active"> sup </div> </div> </div> </div> </div> </div> <div id="available-latest-tab" class="tab-pane fade"> hi </div> </div>
you need:
<div class="available-content tab-content container"> <div id="available-featured-tab"> <div class="featured-list-wrapper"> <div class="row"> <div class="col-md-12"> <div class="featured-list-content"> <div class="featured-tab-body tab-pane fade in active"> sup </div> <div id="available-latest-tab" class="tab-pane fade"> hi </div> </div> </div> </div> </div> </div> </div>
no need jquery, since bootstrap work you. corrected fiddle: http://jsfiddle.net/xfw8t/1777/
Comments
Post a Comment