jQuery tabs - getting newly selected index jQuery tabs - getting newly selected index jquery jquery

jQuery tabs - getting newly selected index


I would take a look at the events for Tabs. The following is taken from the jQuery docs:

 $('.ui-tabs-nav').bind('tabsselect', function(event, ui) {     ui.options // options used to intialize this widget     ui.tab // anchor element of the selected (clicked) tab     ui.panel // element, that contains the contents of the selected (clicked) tab     ui.index // zero-based index of the selected (clicked) tab });

Looks like ui.tab is the way to go.


in jQuery UI - v1.9.2

ui.newTab.index()

to get a base 0 index of active tab