這可能是非常簡單易於修復(或不可能)的,但我一直試圖在頁面加載時實現我的懸停效果。頁面加載時的jQuery背景顏色動畫
我有一個DIV盒子導航系統,和下面的jQuery的動畫它在懸停背景色:
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript">
var $jq = jQuery.noConflict();
/* Menu buttons fade */
$jq(document).ready(function() {
$jq("#box").hover(function() {
$jq(this).stop().animate({ backgroundColor: "#FF9933"}, 400);
},function() {
$jq(this).stop().animate({ backgroundColor: "navy" }, 400);
});
$jq("#box2").hover(function() {
$jq(this).stop().animate({ backgroundColor: "#9DE263"}, 400);
},function() {
$jq(this).stop().animate({ backgroundColor: "navy" }, 400);
});
$jq("#box3").hover(function() {
$jq(this).stop().animate({ backgroundColor: "#0099FF"}, 400);
},function() {
$jq(this).stop().animate({ backgroundColor: "navy" }, 400);
});
$jq("#box4").hover(function() {
$jq(this).stop().animate({ backgroundColor: "#8B0099"}, 400);
},function() {
$jq(this).stop().animate({ backgroundColor: "navy" }, 400);
});
$jq("#box5").hover(function() {
$jq(this).stop().animate({ backgroundColor: "#336666"}, 400);
},function() {
$jq(this).stop().animate({ backgroundColor: "navy" }, 400);
});
});
</script>
我試圖但是做的,就是重複同樣的效果,但是相反,它當頁面加載時發生 - 一個在另一個之後動畫。一個很好的例子是css-tricks - 導航欄按鈕顏色一個接一個顏色。
任何人都可以幫我嗎?
謝謝!
mlazim14
也就是說一些複製粘貼幸福代碼。 – epascarello 2012-04-15 12:41:58