hi 开发者_JAVA技巧im making this image fadeIn and then fadeout again but i have no idea how to loop it.
<div class="slideshow">
<img src="img1.jpg">
<img src="img2.jpg">
<img src="img3.jpg">
<img src="img4.jpg">
<img src="img6.jpg">
<img src="img7.jpg">
<img src="img8.jpg">
<img src="img9.jpg">
<img src="img10.jpg">
</div>
var lis = $('.slideshow img').hide();
$('img:first',lis).show();
var x=0;
(function displayImages() {
lis.eq(i++).fadeIn(600, displayImages);
})();
$('.slideshow img:first-child').fadeIn(500, fadenext);
function fadenext() {
$(this).next().fadeIn(500, fadenext);
}
http://jsfiddle.net/imoda/4CKbZ/
Maybe you could use the fadein callback method to call the next one...
.fadeIn( 600, NextImage );
精彩评论