How can I animate text colors using jQuery?
$(document).ready(function(){
$('a.nav_menu')
.css( {backgroundPosition: "0 0"} )
.mouseover(function(){
$(this).animate({
backgroundPosition:"(-650px 0)",
'color': '#000000'
}, {duration:700})
})
.mouseout(function(){
$(this).animate(开发者_如何转开发{backgroundPosition:"(0px 0)"}, {duration:900, complete:function(){
$(this).css({backgroundPosition: "0 0"})
}})
})
});
What is wrong with this? The text color doesn't change.
You need to either use jQuery UI effects or the color animation plugin to animate colors.
You need to use this plugin to animate colours.
精彩评论