-1

This my script. But his working only in firefox. Please help!

<script>
    $(document).ready(function(){
         $(".catdiv").hover(function(){
            $(this).animate({"backgroundColor": "#FFD800"}, 300);
          }, function(){
            $(this).animate({"backgroundColor": "#161616"}, 200);
          }); 

    });
</script>
user3288430
  • 79
  • 1
  • 3

2 Answers2

1

If you don't mind a non-jQuery (or non-Javascript for that matter) solution:

.catdiv,
.catdiv:hover {
    transition: background-color 500ms;
    -webkit-transition: background-color 500ms;
    -moz-transition: background-color 500ms;
    -ms-transition: background-color 500ms;
    -o-transition: background-color 500ms;
    background-color: #161616
}
.catdiv {
    background-color: #FFD800;
}

Demo: http://jsfiddle.net/L8r6w/1/

couzzi
  • 6,316
  • 3
  • 24
  • 40
0

You have to use the jQuery.color plugin to animate background color. It isn't supported in jQuery because most browsers do now natively handle it.

Link: jQuery Color

Damien Black
  • 5,579
  • 18
  • 24