У меня есть следующий фрагмент кода начальной загрузки после нажатия TabKey в TextBox (ID = «txtMainCat»), который равен TabIndex = 101
, я хочу открыть другую вкладку, которая равна TabIndex = 102
, в настоящее время она не работает «т,перейдите к следующей вкладке с помощью tabindex в bootstrap
<div class="bs-example">
<ul class="nav nav-tabs" id="myTab" >
<li tabindex="100" class="active"><a href="#BasicItemDetails" data-toggle="tab">Main Details</a></li>
<li tabindex="102"><a href="#AssignItem" data-toggle="tab">Company Rules</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane active" id="BasicItemDetails">
<asp:TextBox ID="txtMainCat" TabIndex="101">
</asp:TextBox>
</div>
<div class="tab-pane" id="AssignItem">
<asp:TextBox ID="txtMainCat2" TabIndex="103">
</asp:TextBox>
</div>
</div>
усталым со следующими, кажется, что один также не работает
$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
// store the currently selected tab in the hash value
$("ul.nav-tabs > li > a").on("shown.bs.tab", function (e) {
var id = $(e.target).attr("href").substr(1);
window.location.hash = id;
});
// on load of the page: switch to the currently selected tab
var hash = window.location.hash;
$('#myTab a[href="' + hash + '"]').tab('show');