check the below code
var fun = function() {
$('.recode-list').animate({top:-heigth},quantity*1500,'linear',function() {
console.log(count++);
var temp = $('.recode-list .item:lt('+quantity+')');
var activity = temp.clone();
temp.remove();
$('.recode-list').append(activity);
$('.recode-list').css('top',0);
fun();
});
}
fun();
In that situation the fun
's call stack would be overflow in soon or later,
I need implement the feature what the above code does, a animation loop
How to fixed it?