how do i check which tabs is active using jquery tabs?
+1
A:
Not too sure about this but I think jQuery dynamically assigns a class of 'ui-state-active'
sk747
2010-10-29 04:14:00
Correct, jQuery adds the class `ui-state-active` to the active tab. See http://jqueryui.com/demos/tabs/ with Firebug to see how it works.
Scott
2010-10-29 04:21:13
i need to check it programmatically, so i can do actions related to that
user1111111
2010-10-29 04:35:58
var selected = $tabs.tabs('option', 'selected'); // => 0
user1111111
2010-10-29 04:36:28
+1
A:
Please try with Index
function getIndex(){
return $("ul li.ui-state-active").index();
}
It will returns the index of selected li or tab.
Vishnu K B
2010-10-29 04:42:10