2012-08-07 80 views
0

我有這樣的演示:動畫代碼不起作用

jsfiddle.net

$(document).ready(function(e) {   
    $(".footer-list li").mouseover(function() { 
     $(this).animate({ backgroundColor: "#d31d4a" }, 1500); 
     // $(this).css("background-color", "#d31d4a"); 
    }); 
}); 

動畫代碼不工作,我不知道爲什麼!

當我使用.css時,它沒有任何問題。

誰能告訴我問題是什麼?

+0

發佈相關代碼,而不僅僅是一個鏈接 – 2012-08-07 00:26:21

回答

1

正如有人說,jQuery的.animate()默認情況下不會做色彩的動畫。使其工作的另一個選項是包括jQuery UI,其中(其中包括)「升級」默認的.animate()方法(如此處所示:http://jsfiddle.net/nnnnnn/WFVby/3/)。