So I have a list of divs that have alternating background colors through jQuery. These also have rollovers that change the background color. The problem is, the rollover function only allows me to animate this class back to one background color on mouseout, but like I said before, I have an alternating background color. How can I handle this in jQuery? My code below was my attempt at an if, else statement with even and odd, but I don't know the proper syntax.
$(document).ready(function() {
$('.whycapad_staff:even').css({"background-color":"#eaebeb"});
$('.whycapad_staff').hover(function() {
$(this).stop().animate({"background-color":"#5facf8"}, 300);
}, function(){
if ($(this = ':even')){
$(this).stop().animate({"background-color":"#eaebeb"}, 300)
};
else {
$(this).stop().animate({"background-color":"#FFFFFF"}, 300)
}
})
})