我想创建一个基本的jQuery 2图像幻灯片。我不希望图像相互融合,他们应该只是简单地改变每一秒。 在下面的jQuery代码中,代码包含淡入淡出。什么是没有衰落的正确的代码?基本2图像幻灯片在Jquery
<div id="manwrapper">
<div>
<img src="images/index-man.png" width="500" height="788" alt="SS Image" />
</div>
<div>
<img src="images/index-man2.png" width="500" height="788" alt="SS Image" />
</div>
</div>
<!--end manwrapper-->
CSS
#container #manwrapper {
float: right;
margin-top: -280px;
z-index: 3;
position:relative;
width:500px;
height:788px;
}
#container #manwrapper > div {
position:absolute;
}
的JavaScript
setInterval(function() {
$('#manwrapper > div:first')
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo('#manwrapper');
}, 3000);
你试图删除的行'.fadeOut(1000)'和'.fadeIn(1000)'? – hexblot
是的,这确实有用。谢谢! – user2382538