手动激活选项卡jQuery UI 1.10.3 [英] Manually activate tabs jquery ui 1.10.3

查看:58
本文介绍了手动激活选项卡jQuery UI 1.10.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很生气,我搜索了jQuery ui doc 和stackoverflow的问题(大量问题),但我不知道如何手动激活标签页()在jquery 1.10+中.

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.

这篇关于手动激活选项卡jQuery UI 1.10.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆