jquery ui tabs - get loaded tab in load event -


i'm using jquery ui tabs (from ui version 1.9.2), , tabs loading remotely via ajax.

in api documentation (http://api.jqueryui.com/1.9/tabs/#event-load), seems suggest can index of loaded tab way:

$(".tabs").tabs({     load: function(event,ui) { console.log(ui.tab.index());  } }); 

however, doesn't work. error because ui.tab undefined

when console.log ui.tab full url of tab loaded, leading me believe ui.tab not kind of object i'm expecting be. tried using ui.panel.index() same undefined error.

i can index of activated tab using activate event , ui.newtab.index(), that's not i'm looking for.

what missing?

it appear jquery ui docs haven't been updated or in error (and/or intended implementation not correct). ui.tab returning dom node, not jquery object docs suggest.

this index of tab you:

$("#tabs").tabs({     load:function(event,ui) {          var index = $(ui.tab).parent().index();           console.log(index);     } }); 

if plan on using ui.tab node in function other purpose may better cache first.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -