so i have grabbed a snippet from another question
<script type='text/javascript' >
$(document).ready(function () {
$("div.content ul li a")
.mouseover(function () {
var t = $(this);
if (!t.hasClass("clicked")) { // very easy to check if element has a set of styles
t.addClass('mouseover');
}
})
.mouseout(function () { // attach event here instead of inside mouse over
$(this).removeClass('mouseover');
});
$("div.content ul li a").click(function () {
var t = $(this);
t.toggleClass("clicked");
if (t.hasClass("clicked")) {
t.removeClass('mouseover');
} else {
t.addClass('mouseover');
}
});
});
</script>
the only last thing i wanted is to restore the tabs normal css when another tab is clicked. for example the tab's bgcolors are white when i click tab1 it becomes black when i go into Tab2..Tab1 goes white and Tab2 goes black
<ul>
<li>
<a href="#Tab1">Tab 1</a>
</li>
<li>
<a href="#Tab2">Tab 2</a>
</li>
</ul>
let's say here's the CSS part
ul li a {background-color: white;}
ul li a.mouseover {background-color: black;}
ul li a.mouseout {background-olor: white;}
ul li a.clicked {background-color: black;}