简体   繁体   中英

jquery-ui 1.10.2 tabs selecting

Using jquery-ui 1.10.2, I am unable to select a tab as usual. I am using $('.selector').tabs('select', '.selector'); as with earlier versions of jquery-ui.

What is the replacement for this functionality in the latest version of jquery-ui.

I have created a jsFiddle test here . ( http://jsfiddle.net/jgergen/5RMaN/37/ ).

Thank you, Jim

Move $('#tSheet').tabs(); to the bottom after appending the elements.

$('#tSheet ul').append('<li><a href="#page-1">One</a></li>');
$('#tSheet ul').append('<li><a href="#page-2">Two</a></li>');
$('#tSheet ul').append('<li><a href="#page-3">Three</a></li>');

$('#tSheet').append('<div id="page-1">Page One Text</div>');
$('#tSheet').append('<div id="page-2">Page Two Text</div>');
$('#tSheet').append('<div id="page-3">Page Three Text</div>');
$('#tSheet').tabs();

Fiddle

For dynamic tabs use this syntax $('#tSheet').tabs("option", "active", 2);

For the latest version of jquery-ui - 'select' is not longer available. To select a tab, you must use the options. The following code will select a tab.

// tabs are 0 based indexed
$('#tSheet').tabs('options', 'active', 1);
// will select the second tab.

Still have not found a way to get the tab index without a lot of DOM navigation. it would be nice to have something like this: $('#tSheet').tabs('find', '.selector');

Thank you all for your help. Jim

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM