这可能是非常简单易于修复(或不可能)的,但我一直试图在页面加载时实现我的悬停效果。页面加载时的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