tags:

views:

33

answers:

3

Why isn't this piece of code working?

$("#TextOne").animate({ color: "#FFFF00" }, 800);

When i call it on a button click it does nothing. I have Chrome.

+2  A: 

Are you using the color plugin (or jQuery UI)?

Without one of these it won't work because jQuery does not natively support the animation of color properties.

J-P
+3  A: 

You can't fade colors :( You need Color plugin for that :)

Sarfraz
*wondering why I've got no votes yet posted 1 minute before you :(*
J-P
@J-P: Not sure either but +1 from my side :)
Sarfraz
@sAc, thanks :)
J-P
@J-P: No problem you deserve it :)
Sarfraz
A: 

Try the following.

define a css color like this.

.anim-color
    {
        color:##FFFF00;
    }

animate on a class like this.

$("#TextOne").animate({ className: 'anim-color' }, 800);
mohang