Reputation: 3080
I have a simple Tab setup using jquery.
I use the following function to create a extra jQuery tab and insert it where I please
$('#tabs').tabs('add', "ElementId", "Tab Text", intPosition);
The buy can be seen here.
The theme helps to clearly show that the latest tab that is inserted as a extra span around the text of the tab
<li class="ui-state-default ui-corner-top">
<a href="#ui-tabs-2">
<span>Delivery 66</span>
</a>
</li>
Can any one explain why it adds the span when adding tabs but not when creating the initally?
I believe this may be a bug of jQuery?
Upvotes: 2
Views: 285
Reputation: 11820
That span is part of the default when adding a new tab. Check out "tabTemplate" option - http://jqueryui.com/demos/tabs/#option-tabTemplate.
If you want to change the tabTemplate, just add in your own:
$('.selector').tabs({ tabTemplate: '<li><a href="#{href}">#{label}</a></li>' });
Updated fiddle: http://jsfiddle.net/qKBUu/89/
Upvotes: 2