我试图弄清楚如何在页面加载时使 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() 函数吗?如果是这样,在这种情况下我将如何实现它?
感谢您提供任何帮助。