While adding a new tab and using JQuery.index like this:
var index = $('#container-1 li').index($(this).parent());
It always returns -1 in IE7, but normal in Firefox.
Demo: http://hctgroup.vicp.hk/test.html
//jquery-1.2.6.min.js
//ui.tabs.js
$(document).ready(function(){$('#container-1 ul').tabs
({add:addEventHandler}); });
function addEventHandler(lnk){
var li = $(lnk).parent();
$('<img src="close-off.gif" class="ui-tabs-button" />')
.appendTo(li)
.hover(function(){
var img = $(this);
img.attr('src','close-over.gif');
},
function(){
var img = $(this);
img.attr('src','close-off.gif');
}
)
.click(closeEventHandler);
}
function closeEventHandler(){
var index = $('#container-1 li').index($(this).parent());
$('#container-1 ul').tabsRemove(index+1);
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---