I'm changing the colors of a table rows on hover with jQuery and I've noticed that in the following instances I get different results.
The CSS is as follows:
.normalcolor {
background-color: #dedede;
}
.reddishcolor {
background-color: #ffc59c;
}
.hovercolor {
background-color: #f1e1c0;
}
Now, I'm doing the hover effect with jQuery, using this code:
$("table.withhover tr").hover(function(){
$(this).addClass("hovercolor");
}, function(){
$(this).removeClass("hovercolor");
});
The strange thing is that when I hover over a row with class="normalcolor"
, the background color changes to the one from .hovercolor
. However, when I hover a row with class="reddishcolor"
the background color doesn't change.
Is this normal? And if yes, why? It has anything to do with the colors?
Thanks!