Jquery alternate row color doesn't seem to work after hover function...

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-03-23T09:54:48Z Indexed on 2010/03/23 10:03 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

I use the following jquery statements,

$(".resultsdiv:odd").css("background-color", "#fff");
$(".resultsdiv:even").css("background-color", "#EFF1F1");
$('.resultsdiv').hover(function() {
      $(this).css('background-color', '#f4f2f2');
   },
   function() {
      $(this).css('background-color', '#fff');
});

Alternate seems to be ok initially but after hover over a div element it doesn't work ... Any suggestion...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about hover