1

I have absolutely no idea why the background color isn't changing and I've spent far too much time on it already:

<input type="button" class="front-consultation-btn" value="Get A Free Consultation">

<script>
    $('.front-consultation-btn').animate({ backgroundColor: '#FF0000', width: 400 }, 500);
</script>

Why does this ONLY change the width property?

Goz
  • 61,365
  • 24
  • 124
  • 204
dcolumbus
  • 9,596
  • 26
  • 100
  • 165

2 Answers2

2

This is because jQuery doesn't support animating colors by default, jQueryUI adds this functionality: http://jqueryui.com/demos/animate/

RdeWolf
  • 21
  • 1
1

Why not use CSS3?

.yourelement {
    background: #fff;
}

.yourelement:focus, .yourelement:hover {  
    -webkit-transition: background-color 0.5s linear;   
    background: #ccc;   
}  
Zoltan Toth
  • 46,981
  • 12
  • 120
  • 134
matt
  • 1,015
  • 4
  • 14
  • 28