jQuery:动画文本颜色的输入字段? [英] jQuery: animate text color for input field?
问题描述
我有一个非常简单的代码,我认为是正确的方法来获取jQuery为给定的输入字段的文本颜色设置动画。
I've got this really simple piece of code that I thought was the correct way to get jQuery to animate the text color for a given input field.
$('input').animate({color: '#f00'}, 500);
但它不会工作。但是,我可以更改文本颜色:
But it won't work. However, I can change the text color:
$('input').css('color', '#f00');
我在Safari 4和Firefox 3.5中使用相同的
I've tried this in both Safari 4 and Firefox 3.5 with the same (lacking) results. I'd really appreciate any input on this problem as I'm running out of hair... Thanks.
推荐答案
我真的很感谢任何关于这个问题的输入, p> jQuery不支持颜色动画,因此您需要颜色插件或< a href =http://jqueryui.com/ =nofollow noreferrer> jQuery UI 。两者都允许您使用您用于背景颜色和颜色等属性的语法。
jQuery doesn't support color animations so you'll need the color plugin or, jQuery UI. Both allow you to use the syntax you're using for properties like background-color and color.
这篇关于jQuery:动画文本颜色的输入字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!