手动激活选项卡jQuery UI 1.10.3
我真的很生气,我搜索了jQuery ui doc 和stackoverflow的问题(大量问题),但我不知道如何手动激活标签页(
I am really getting mad, I searched through jquery ui doc and stackoverflow's questions (tons of questions) but I cannot figure out how to manually activate tabs ( .tabs()
) in jquery 1.10+ .
我创建并尝试了此解决方案:
I founded and tried this solution :
$(mytabs).tabs("option", "active", index);
,但似乎无法解决.有人可以帮助我知道如何激活标签页吗,例如当我create
一个新的?
but it does not seem to work out. Can someone help me to know how to activate a tab , e.g. when I create
a new one?
我无法弄清楚jQuery UI如何不再实现我所知道的实现目标的select
事件.
I can't figure out how jQuery UI has no longer the select
event that , as I could know, accomplished this goal.
我正在使用function
创建新的tabs
:
var addTab = function() {
var tabTemplate = "<li><a href='#tabs-1'>non titolato</a></li>";
var li = $.parseHTML(tabTemplate);
$(li).addClass('ui-corner-all');
$(".ui-tabs-nav").append(li);
$("#stepBuilder").tabs('refresh');
}
我想激活最后一个创建的.
I would like to activate the last one that was created.
使用以下命令激活最后一个标签.
Use the following to activate the last tab.
$("#stepBuilder").tabs({ active: -1 });
我已经在jsfiddle.net上为您创建了一个示例.
I've created an example for you on jsfiddle.net.
API文档关于activate
选项:
active
类型:布尔值或整数 默认值:0
Type: Boolean or Integer Default: 0
哪个面板当前处于打开状态.
Which panel is currently open.
支持多种类型:
布尔值:将active设置为false将折叠所有面板.这要求可折叠选项为true.
Boolean: Setting active to false will collapse all panels. This requires the collapsible option to be true.
Integer:活动(打开)的面板的从零开始的索引.负值选择从上一个倒退的面板 面板.
Integer: The zero-based index of the panel that is active (open). A negative value selects panels going backward from the last panel.