简体   繁体   English

jquery-ui 1.10.2选项卡选择

[英]jquery-ui 1.10.2 tabs selecting

Using jquery-ui 1.10.2, I am unable to select a tab as usual. 使用jquery-ui 1.10.2,我无法照常选择选项卡。 I am using $('.selector').tabs('select', '.selector'); 我正在使用$('.selector').tabs('select', '.selector'); as with earlier versions of jquery-ui. 与早期版本的jquery-ui一样。

What is the replacement for this functionality in the latest version of jquery-ui. 最新版本的jquery-ui中该功能的替代品是什么。

I have created a jsFiddle test here . 我在这里创建了一个jsFiddle测试。 ( http://jsfiddle.net/jgergen/5RMaN/37/ ). http://jsfiddle.net/jgergen/5RMaN/37/ )。

Thank you, Jim 谢谢吉姆

Move $('#tSheet').tabs(); 移动$('#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); 对于动态制表符,请使用以下语法$('#tSheet').tabs("option", "active", 2);

For the latest version of jquery-ui - 'select' is not longer available. 对于最新版本的jquery-ui-'select'不再可用。 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. 仍然没有找到一种无需大量DOM导航即可获取标签索引的方法。 it would be nice to have something like this: $('#tSheet').tabs('find', '.selector'); 最好有这样的东西: $('#tSheet').tabs('find', '.selector');

Thank you all for your help. 谢谢大家的帮助。 Jim 吉姆

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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