2010-01-05 62 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