How to use setTimeout to delay iterations with .each() method...
I'm sort of lost on this one. I've looked at many different examples and tried many combinations but I still can't get this to work. Here's the code without the setTimeout:
- $(seq).each(function(index, value){
- var divID = "#div-" + value;
- $(divID).animate({
- borderWidth: ['10px', 'swing']
- }, 200, 'linear')
- .animate({
- borderWidth: ['1px', 'swing']
- }, 200, 'linear');
-
- });
This works except that sometimes the animation for one div element will sometimes happen at the same time as another div element. I need a delay between each iteration (not between the two borderWidth animations) but I'm confused by how I should write this. Any help is greatly appreciated. Thanks!