2011-12-08 136 views
0

我想弄清楚如何淡入淡出我的網站的CSS背景顏色。不過,我只是用div或標籤獲取背景圖片才能淡入淡出。沒有隻是一個CSS背景顏色的例子淡入。CSS背景淡入淡出使用jquery

<style type="text/css"> 
body { 
    background-color: #F00; 
} 
</style> 

任何幫助將是偉大的,在計算這個簡單的問題。

大衛

+0

http://stackoverflow.com/questions/190560/jquery-animate-backgroundcolor這可能會幫助 – Joshc

回答

1

有可用的,可以輕鬆地完成此功能幾個插件:

jQuery Color Plugin

jQueryUI Color Animations:

Bitstorm Color Animation

使用幾乎所有的人:

$('body').animate({ backgroundColor: "White" }, 'slow'); 


$(this).animate({ backgroundColor: "black" }, 1000); 
+0

你碰巧有該網站的JavaScript,因爲該網站是關閉它似乎? – StealthRT

+0

@Rionmonster插件網站當前不可用。 –

+0

這裏是一個教程,可能包括在下載插件:http://desizntech.info/2009/06/playing-with-jquery-color-plugin-and-color-animation/ –