ok I search the forum before posting here & found many solution. unfortunately not a single one is working for me. I’m using latest bootsrap v3.3.5 & when ever I try to change my tabs the page jump to top & the content from the tab panel goes down.
<div id="featured-tabs">
<!-- Nav tabs -->
<ul class="list-inline" role="tablist">
<li role="presentation" class="active"><a href="#residential" aria-controls="residential" role="tab" data-toggle="tab" class="btn btn-theme-primary btn-lg">Residential</a></li>
<li role="presentation"><a href="#commercial" aria-controls="commercial" role="tab" data-toggle="tab" class="btn btn-theme-secondary btn-lg">Commercial</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="residential">
....content here
</div>
<div role="tabpanel" class="tab-pane fade" id="commercial">
....content here
</div>
</div>
</div>
& here is my js:
$('#featured-tabs ul.list-inline li a').click(function (e) {
e.preventDefault();
$(this).tab('show');
history.pushState( null, null, $(this).attr('href') );
})
so how I can solve this page jump problem for latest Bootstrap version?
2
Answers
Check if you have jquery and bootstrap.js files before closing bod tag
You can use it without javascript as it says in bootstrap
http://getbootstrap.com/javascript/#tabs
just:
here demo http://jsbin.com/vafetewawe/edit?html,output
Try using this: