After Much frustration and reading of various posts and the jquery
Documentation I created the following function:
var $MainTabs = $("#TabbedContentId").tabs();
function getIndexForId(searchId){
var existingIndex = $MainTabs.tabs('option','selected');
var myIndex = $MainTabs.tabs("select",
searchId).tabs('option','selected');
$MainTabs.tabs("select", existingIndex);
return myIndex;
}
it works and the best part is it is built entirely on jquery, no external
functions needed.
Girish Venkatachalam-2 wrote:
>
>
> On 18:21:00 Nov 01, Marta Figueiredo wrote:
>>
>> Hello,
>>
>> I'm using Jquery UI tabs. How can I get the tab ID by its index?
>>
>
>
> Does this work?
>
> var $tab = $(<foo bar selector>).tabs();
>
> $tab.tabs('select', index);
>
> alert($('#footabs > li a').attr("id"));
>
> I hope I did not misunderstand your question?
>
> -Girish
>
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "jQuery UI" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/jquery-ui?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
>
--
View this message in context:
http://old.nabble.com/Get-tab-ID-from-tab-index-tp20285239s27240p28838697.html
Sent from the jQuery UI Discussion mailing list archive at Nabble.com.
--
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en.