I have small animation made with jQuery (panels goes up and comes down). But I am not able to make it a loop. So it would do it continuesly. Here’s the code so far:
$(document).ready(function() {
startAni();
});
function startAni() {
setTimeout(function() {
$('.ani .panels').animate({
top: '-350px',
}, 2500, function() {
setTimeout(function() {
$('.ani .panels').animate({
top: '0px',
}, 2500, function() {
});
}, 1000);
});
}, 1000);
//startAni();
}
So it works perfectly once (the panels div goes up, stays there for 1sec and then comes back down. How can I change this in to loop? I tried calling the same function inside the function but that just killed it :/
Thanks!
This example works:
http://jsbin.com/esaraj/4/edit#javascript,html,live