TextBox Foreground color in jquery

前端 未结 3 343
北荒
北荒 2021-01-28 05:12

Why isn\'t this piece of code working?

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

When i call it on a button click it does nothing.

相关标签:
3条回答
  • 2021-01-28 05:38

    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);
    
    0 讨论(0)
  • 2021-01-28 05:52

    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.

    0 讨论(0)
  • 2021-01-28 06:03

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

    0 讨论(0)
提交回复
热议问题