Whoops that's wrong (though it gave the correct answer in my trivial
test case).
My first answer would break if any pane contained other lists with <a>
tags.
This is more robust:
$("#tabs>ul>li>a").eq(1).attr("href") // finds the href of the
second tab.
This could be made real easy if you added a mnemonic helper-class, say
class="foo", to each <a> tag. Then it becomes
$(".foo").eq(1).attr("href") // finds the href of the second tab.
**--** Steve
On Jan 5, 12:32 am, Steven Black <[email protected]> wrote:
> Several ways, among them:
>
> $("#tabs").find("li>a").eq(1).attr("href") // finds the href of the
> second tab.
>
> **--** Stve
>
> On Jan 4, 11:08 pm, Clayton Dukes <[email protected]> wrote:
>
> > Is there a way I can get the href for a given tab index number?
>
> > <div id="tabs" class="ui-tabs" style="position: relative; top: 20px;
> > left: 1px;">
> > <ul>
> > <li><a href="#tab-Main">Main</a><span class="ui-icon
> > ui-icon-close">Remove Tab</span></li>
> > <li><a href="#tab-Graphs">Graphs</a><span class="ui-icon
> > ui-icon-close">Remove Tab</span></li>
> > <li><a href="#tab-Table">Table</a><span class="ui-icon
> > ui-icon-close">Remove Tab</span></li>
> > </ul>
> > </div>
> > <script type="text/javascript">
> > $('#tabs span.ui-icon-close').live('click', function() {
> > var index = $('li',$tabs).index($(this).parent());
> > var tabName = ????????? <-- This is what I need
> > $('#msgbox_br').jGrowl('Deleted tab ' + tabName);
> > $(tabName).css("display","none");
> > $('a[href^=' + tabName + ']').parent().remove();
> > });});
>
> > <script>
>
> > --
> > ______________________________________________________________
>
> > Clayton Dukes
> > ______________________________________________________________
>
>
--
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.