我需要在按下按鈕時更改選項卡,並且選項卡應該由id標識。下面的代碼不爲我工作 - 只是重新加載頁面:如何在按下按鈕時更改Twitter Bootstrap選項卡?
<div class="form-actions">
<button class="btn btn-primary" id="btn-next">Next</button>
<button type="reset" class="btn">Clear</button>
</div>
...
<div class="tab-pane active" id="2">
...
$("#btn-next").click(function(event) {
$('#2').tab('show');
});
奇怪的,但它不工作在我的情況下(我使用'#2''而不是''#tab'')。現場示例中只有一次(如果我第二次按Next,jsbin顯示代碼)。我使用最新版本的FF。 – 2012-02-13 20:35:41
不要將數字作爲身份證號碼...始終以字母開頭! – balexandre 2012-02-13 20:38:33
@balexandre jsbin確實有LA_所描述的錯誤,但在我的代碼中工作正常。謝謝 – arbme 2012-02-14 06:01:32