Reputation: 5285
Is there any simple way to specify the default selected tab on jQueryUI
Tabs by tab id, instead the tab index?
Upvotes: 0
Views: 1212
Reputation: 9148
Try something like this maybe:
//executes on load
$(function () {
$("#tabs").tabs({ selected: 2 });
});
Upvotes: 1
Reputation: 126042
You could tap into the create
event and select a tab by id there:
$("#tabs").tabs({
create: function() {
$(this).tabs("select", "#tabs-2");
}
});
Upvotes: 0
Reputation: 9661
var SelectedTab = $('ul li#yourId').index();
$( ".selector" ).tabs({ selected: SelectedTab })
Upvotes: 1