I wrote a script
setInterval(function(){
$('#vslides').animate({
top: "-=1960"
}, 60000, function(){
$('.vslide:last').after($('.vslide:first'));
$('#vslides').css('top', '0px');
});
}, 60000);
It works nice, scrolls the almost 2000px
image in a minute, but, at the end it stops. I need it to continue to the next image (same image, just repeated) and keep going... I have tried several things, but can't seem to get it right. How do I make it continuous, and remove the stop/pause at the end of the interval?
You need some kind of recursive function. Here's a solution that provides a single function for animating one element, but also accepts a callback function. Then we create a second function that will recursively iterate through all the elements in a wrapped set, call our animating function, and pass in a callback that will increment our index and call our recurse function again to animate the next element.