tabs add: not binding?
tabs add: not binding?
Hello
I have some tabs, set up with a custom close-button...
// Establish tabs...
var $tabs = $('#right-body > ul').tabs({
add: function(ui) {
var li = $(ui.tab).parents('li:eq(0)')[0];
$('<div class="close-tab"></
div>').appendTo(li)
.bind('click', function() {
console.log( $('li',
$tabs).index(li) );
$tabs.tabs('remove', $('li',
$tabs).index(li));
});
}
});
This works just fine if the trigger is local and not dynamic.
Clicking the tab loads a dynamic page containing a button that opens
the panel into a new panel.
When done this way, the close-tab is not appended because li is
undefined or empty.
I have tried using livequery to rebind it, but have not had luck with
it so far.
Any ideas?
Will tabs ever have close buttons built in ? :-)