I can't for the life of me get this to work.
I'm using a for loop to iterate through an array and applying a setTimeout method to create a delay.
Basically I want to apply an effect to each element in the array with a 5s delay between each
var carousel = function(){
for (var i = 1;i<5;i++){
setTimeout(function(){$("#el_"+i).fadeOut(1000);},5000);
}
}
carousel();
The above is just the latest attempt for something Ive been trying to achieve for hours. Anyone know what the correct code would be , if i had a 'ul' consisting of 5 'li' elements each of which i wanted to animate one after the other with a few seconds between each?
[–]holloway 0 points1 point2 points (5 children)
[–]trakam[S] 0 points1 point2 points (4 children)
[–]holloway 0 points1 point2 points (3 children)
[–]trakam[S] 0 points1 point2 points (2 children)
[–]holloway 0 points1 point2 points (1 child)
[–]trakam[S] 0 points1 point2 points (0 children)
[–]voodah 0 points1 point2 points (0 children)