admin管理员组文章数量:1302419
I have following html to show tabs control of jquery:
<div id="tabs" class="news1">
<ul>
<li><a href="#tabs-1">Track</a></li>
<li><a href="#tabs-2">History</a></li>
</ul>
<div id="tabs-1">
</div>
<div id="tabs-2">
</div>
</div>
On page load, following script is written:
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
On page load, tab-1 is selected by default. How can I Programmatically select tab-2 using JavaScript or jQuery?
I have following html to show tabs control of jquery:
<div id="tabs" class="news1">
<ul>
<li><a href="#tabs-1">Track</a></li>
<li><a href="#tabs-2">History</a></li>
</ul>
<div id="tabs-1">
</div>
<div id="tabs-2">
</div>
</div>
On page load, following script is written:
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
On page load, tab-1 is selected by default. How can I Programmatically select tab-2 using JavaScript or jQuery?
Share Improve this question edited Mar 17, 2013 at 9:58 Ram 145k16 gold badges172 silver badges200 bronze badges asked Mar 17, 2013 at 9:50 AzeemAzeem 2,92418 gold badges56 silver badges89 bronze badges2 Answers
Reset to default 6You can specify the active option, which must be set to the zero-based index of the tab you want to activate:
$("#tabs").tabs({
active: 1
});
$("selector").tabs("option", {
"selected": 1,
"disabled": [0]
});
本文标签: javascriptJquery tabs controlhow to select tabStack Overflow
版权声明:本文标题:javascript - Jquery tabs control - how to select tab - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741699414a2393199.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论