 <p>If you need to avoid the final slide back to the first and just restart, I would suggest a slight change over Pushpesh's answer:</p> <pre><code>$(document).ready(function() { var currentPosition = 0; var slideWidth = 500; var slides = $('.slide'); var numberOfSlides = slides.length; var slideShowInterval; var speed = 900; var lastSlideReached = false; slides.wrapAll('&lt;div id="slidesHolder"&gt;&lt;/div&gt;'); slides.css({ 'float' : 'left' }); $('#slidesHolder').css('width', slideWidth * numberOfSlides); slideShowInterval = setInterval(changePosition, speed); function changePosition() { if( ! lastSlideReached ) { if(currentPosition == (numberOfSlides-1)) { lastSlideReached = true; } else { currentPosition++; } moveSlide(); } else { resetSlide() } } function moveSlide() { $('#slidesHolder').animate({'marginLeft' : slideWidth*(-currentPosition)}); } function resetSlide(){ currentPosition = 0; $('#slidesHolder').css('marginLeft', currentPosition ); lastSlideReached = false; } </code></pre> <p>});​</p> <p>cheers</p>