我有一個名爲#link的鏈接。在jQuery中鏈接動畫顏色變化?
它懸停後改變顏色,就像這樣:
$("#link").hover(function(){
$(this).css({color: '#fed900'});
});
所有我想要做的就是流暢,動畫的顏色變化。
我知道我必須將.css放在.animation中,但不知道如何。
我認爲這是正確的方式,但它好好嘗試在所有的工作:
$("#link").hover(function(){
$(this).animate({ css({color: '#fed900'}) }, "slow");
});
我也試過這樣:
$(this).animate({ .css({color: '#fed900'}), "slow" });
但我還是錯了不知何故。任何幫助的手?我知道我錯過了一些非常小的東西。
[jQuery animate backgroundColor]的可能重複(http://stackoverflow.com/questions/190560/jquery-animate-backgroundcolor) – mercator 2010-12-03 10:06:09