2010-01-05 66 views
1
$(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"}) 
      }}) 
     }) 
}); 

这是什么问题?文字颜色不会更改。如何使用jQuery为文字颜色添加动画?

+0

[jQuery animate backgroundColor]的可能重复(http://stackoverflow.com/questions/190560/jquery-animate-backgroundcolor) – mercator 2010-12-03 10:01:16

回答

0

您需要使用this插件来为动画颜色添加动画。

+0

告诉我们“this”是什么。当提供答案时,想象链接不存在。 – Sampson 2010-01-05 18:55:23