I need to modify the css of .ui-state-active , .ui-widget-content .ui-state-active to the following:
.ui-state-active , .ui-widget-content .ui-state-active {
You could put the code in the select
event of the tab control
$( "#tabs" ).tabs({
select: function(event, ui) {
//ui.item has the current object for you.
}
});
http://docs.jquery.com/UI/Tabs#event-select
If I don't misunderstand your question, you could simply do as following:
$('#tabs .tab-menu li a').click(function() {
$('#tabs .tab-menu li').css('background-image', 'url("images/original-bg.png")');
$(this).parent().css('background-image', 'url("images/tab-over.png")';
});
WHOA! Way over-extending things here!
OK, First of all, jQuery is great, but it has already done the work. To do what you are trying to achieve, you don't need ANY JavaScript of any kind. Use simple CSS.
Watch:
/* FYI: The following CSS selector can also be used to make changes
via JavaScript/jQuery to Currently selected tab.
I have a blog post about that I'll list at the end of my answer */
.ui-tabs-selected {
background-image: url('images/tab-over.png') !important;
} /* This will change the background of the
currently selected li element acting as the tab */
/* If you would like to change the background or something of current panel,
you would access it with the following CSS selector */
.ui-tabs-panel:not(.ui-tabs-hide) {
background-image: url('images/tab-over.png') !important;
} /* This will change the background of the
currently selected div element acting as the panel */
As for that link I promised earlier, this blog post goes into much more depth about ez access to currently selected tabs "outside" of the "tabs events".