Try (with latest version from SVN): var $tabs = $('.ui-tabs-nav').tabs({ select: function(ui) { alert( $('a', $tabs).index(ui.tab) ); } });
Maybe it is a good idea to attach the index to the ui object, so that you could do: alert(ui.index); or something similiar... this question pops up from time to time. I'll add that to my Todos. --Klaus On Apr 4, 4:49 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, I'm trying to incorporate jquery tabs to a project at work. I > read in the documentation that you can bind to stages of the tab. I > would like to bind to the tabselect stage i.e. > > $('.ui-tabs-nav').bind('tabsselect', function(event, ui) { > ui.instance // internal widget instance > ui.options // options used to intialize this widget > ui.tab // anchor element of the currently shown tab > ui.panel // element, that contains the contents of the currently > shown tab > > }); > > My question is that I really need to be able to figure out the index > of the ui element in all tabs inside of the bind statement. Could > someone shine some light as what's the best way to do it? I looked > closely at the ui object but didn't find anything. Perhaps I just > missed it. > > Help is appreciated. > > Thanks!