2012-06-29 106 views

回答

8

工作演示http://jsfiddle.net/aqrvA/8/

加入jQuery用戶界面庫,以及請大家會像火箭! <您的代碼是罰款>

jQuery UI的鏈接:http://jqueryui.com/

希望這有助於:)

腳本:

<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> 
    <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script> 

代碼

$(document).ready(function(){ 
    $("html body").animate({ backgroundColor: "#000000" }, 1000); 
});​ 
+0

謝謝你,很好。 – johnsonwi

+0

@johnsonwi:確保接受解決你的問題的答案。 – Nope

+0

@FrançoisWahl感謝你的精彩:) @ johnsonwi很高興能幫到你! –

2

使用 jQuery的你不能動畫的色彩。您必須使用jQuery UI,將動畫擴展爲顏色。 Look here :)

1

「jQuery UI效果核心擴展了動畫功能,以便能夠生成動畫顏色。這些轉變可以動畫背景 和邊框顏色和接受的顏色在十六進制,RGB和顏色指定 名稱「。

,直到您裝入jquery-ui.js

https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js

您將無法使用動畫功能

這就是你所需要的。