【发布时间】:2010-06-15 20:51:38
【问题描述】:
我正在尝试弄清楚如何在页面加载时使 4 张图像按顺序淡入。
以下是我的(业余)代码:
这是 HTML:
<div id="outercorners">
<img id="corner1" src="images/corner1.gif" width="6" height="6" alt=""/>
<img id="corner2" src="images/corner2.gif" width="6" height="6" alt=""/>
<img id="corner3" src="images/corner3.gif" width="6" height="6" alt=""/>
<img id="corner4" src="images/corner4.gif" width="6" height="6" alt=""/>
</div><!-- end #outercorners-->
这里是 JQuery:
$(document).ready(function() {
$("#corner1").fadeIn("2000", function(){
$("#corner3").fadeIn("4000", function(){
$("#corner2").fadeIn("6000", function(){
$("#corner4").fadeIn("8000", function(){
});
});
});
});
这是css:
#outercorners {
position: fixed;
top:186px;
left:186px;
width:558px;
height:372px;
}
#corner1 {
position: fixed;
top:186px;
left:186px;
display: none;
}
#corner2 {
position: fixed;
top:186px;
left:744px;
display: none;
}
#corner3 {
position: fixed;
top:558px;
left:744px;
display: none;
}
#corner4 {
position: fixed;
top:558px;
left:186px;
display: none;
}
它们似乎只是对我眨眼,而不是按照我赋予它们的顺序淡入淡出。我应该使用 queue() 函数吗?如果是这样,在这种情况下我将如何实现它?
感谢您的帮助。
【问题讨论】:
标签: jquery queue fadein sequential