以下是我遇到的问题的快照:
当我按下它时,它会重定向到下一个标签,但不会更改活动标签
但我希望这个
我的代码
compound
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab"><icon class="fa fa-home"></icon> Profile</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="home">
<!---adding form -->
<div class="container">
<div class="row">
<form role="form">
..........
<div class="row">
<div class="col-xs-3 col-sm-3 col-md-3">
<span class="button-checkbox">
***<button type="button" class="btn" data-color="info" data-toggle="tab" data-target="#profile" tabindex="9">NEXT</button>***
</span>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="profile">.safsdgd..
</div>
</div>
</div>
答案 0 :(得分:0)
这应该从所有菜单项中删除活动类,然后将其添加到单击的
(function($){
$('ul.nav.nav-tabs li').click(function(){
$('ul.nav li').each(function(){
$(this).removeClass('active');
});
$(this).addClass('active');
});
})(jQuery);