Demo: http://hctgroup.vicp.hk/test.html
Please view the code as below:
//jquery-1.2.6.min.js
//ui.tabs.js
//ui.tabs.css
$(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());
alert(index); //Always show me -1 in IE7, but normal in Firefox.
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---