I have a menu and each menu item is a span with a class set in css:
.newClass {color: red}
.oldClass {color:black} oldClass:hover {color:blue;}
When you click on a menu item the class is changed with:
$(this).removeClass('oldClass').addClass('newClass');
which works fine.
When another menuItem is click I change the classes back on the current menu item with:
$(this).removeClass('newClass').addClass('oldClass');
The problem is when the class is changed back, the change is not reflected until I mouse over the menu Item. So the menu item color stays red until I mouse it and then it changes back to black with a blue hover.
See Gaby's example in the comments for what should be happening
Here is my actual code:
$('.headingRev').removeClass('headingRev').addClass('heading');
$(this).removeClass('heading').addClass('headingRev');
and here is the css:
.heading {color: #bb1f1a;}
.heading:hover {color: #e9b49e;text-decoration:none;}
.headingRev {color: #e9b49e;}