非常简单,我只需要一个快速的指针,
Bootstrap按钮组(用于1对3的切换按钮)定义如下:
<!-- Twitter Bootstrap Button Group -->
<div class="btn-group">
<button type="button" class="btn btn-primary">General</button>
<button type="button" class="btn btn-primary">Tab 2</button>
<button type="button" class="btn btn-primary">Tab 3</button>
</div>
点击按钮时,我会选择它以保持其处于活动/按下状态:这是我的当前选项卡,但我需要取消选择其他所有按钮,一次只能切换1个按钮。
$('.btn').click(function(e) {
e.preventDefault();
$(this).addClass('active');
})
// this never unselects other toggle buttons
此外,我应该如何定义每个切换按钮下的内容?