Matteo Pagliazzi
Matteo Pagliazzi

Reputation: 5260

Jquery Ui Tabs: open created tab

I have some tabs created with jQuery UI After I create a new tab using the example in the page I linked, I want that the newly created tab is shown. Is it possible, if so how?

Upvotes: 1

Views: 1102

Answers (2)

5c1260e1c0
5c1260e1c0

Reputation: 65

For recent versions (1.10.x) of jQuery UI, use the following. It's assumed that numberOfTabs is used to keep track of the number of tabs.

$tabs.tabs( "option", "active", numberOfTabs-1 );

Upvotes: 0

Emre Erkan
Emre Erkan

Reputation: 8482

After adding your new tab you can use select method of tabs plug-in with length method. Check my example. I used same demo from jQuery UI demo pages.

$tabs.tabs( "add", "#tabs-" + tab_counter, tab_title ).tabs( 'select', $tabs.tabs('length') - 1);

Upvotes: 1

Related Questions