Reputation: 20444
How would one make this each function keep on performing forever.
$('.featuedbanner img').each(function(){
$(this).delay(featlay).animate({opacity: 1, leaveTransforms:true}, {duration:2000, queue:true});
featlay += 6000;
$(this).delay(featlay).animate({opacity: 0, leaveTransforms:true}, {duration:2000, queue:true});
});
That is to make this an infinite loop
Upvotes: 2
Views: 2349
Reputation: 46008
var loop = function(){
var featlay = 0;
$('.featuedbanner img').each(function(){
$(this).delay(featlay).animate({opacity: 1, leaveTransforms:true}, {duration:2000, queue:true});
featlay += 6000;
$(this).delay(featlay).animate({opacity: 0, leaveTransforms:true}, {duration:2000, queue:true});
});
setTimeout(loop, 0);
};
loop();
Upvotes: 1
Reputation: 8886
You will have to do some thing like this to achieve the following
Also
Upvotes: 3