Manually activate tabs jquery ui 1.10.3 -
i getting mad, searched through jquery ui doc , stackoverflow's questions (tons of questions) cannot figure out how manually activate tabs ( .tabs()
) in jquery 1.10+ .
i founded , tried solution :
$(mytabs).tabs("option", "active", index);
but not seem work out. can me know how activate tab , e.g. when create
new one?
i can't figure out how jquery ui has no longer select
event , know, accomplished goal.
i'm creating new tabs
function
:
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 activate last 1 created.
use following activate last tab.
$("#stepbuilder").tabs({ active: -1 });
i've created an example on jsfiddle.net.
the api doc says activate
option:
active
type: boolean or integer default: 0
which panel open.
multiple types supported:
boolean: setting active false collapse panels. requires collapsible option true.
integer: zero-based index of panel active (open). negative value selects panels going backward last panel.
Comments
Post a Comment