0

hi 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);

            })();

2 Answers 2

2
$('.slideshow img:first-child').fadeIn(500, fadenext);

function fadenext() {
  $(this).next().fadeIn(500, fadenext);
}

http://jsfiddle.net/imoda/4CKbZ/

Sign up to request clarification or add additional context in comments.

Comments

0

Maybe you could use the fadein callback method to call the next one...

.fadeIn( 600, NextImage );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.