我目前有两个图像“图像 A”和“图像 B”。截至目前,我的意图是淡入图像 A,然后淡入其后面的图像 B(同时保持在页面的中心)。然而,相反,图像 B 似乎正在推高图像 A。我正在使用 z-index,但我可能做错了,因为它不是很有效。
在 IMAGE B 中淡入后,正确地我也想将它滑到 IMAGE A 的正上方。谢谢你的帮助!
我附上了一个 jsfiddle 以更好地演示发生了什么:http: //jsfiddle.net/YQwZ6/
HTML:
<style type="text/css">
</style>
<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#pocket').hide().delay(1000).fadeIn(3000).delay(2000);
$('#pop').hide().delay(1000).fadeIn(8000).delay(2000);
});
</script>
<body>
<center>
<div id="pics" align="center">
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="200">
<center>
<div id="pocket" style="z-index:5000"><a><img src="http://www.cjboco.com/assets/page-extras/cj-flashy-slideshow/image_a.jpg"/></a>
</div>
<div id="pop" style="z-index:100"><a><img src="http://www.cjboco.com/assets/page-extras/cj-flashy-slideshow/image_b.jpg"/></a>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
CSS:
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
background-repeat: repeat;
color: #333366;
}
#pocket, #pop {
position:relative;
display: none;
float:center;
}
#pics {
}