delay function not working with each.
what i am doing is when user click on close button first fadeout the popup and then remove style attribute from all li.
issue is fadeout is before the popup fadeout the style attribute is action firing , that is why i used delay to slowdown removeAttr event. but getting some issue with the code..
in one of the article i read to use index with each i tried that one but still not getting issue with.
jQuery('.clsbb').click(function(){
jQuery('.new-rows').fadeOut(3000);
jQuery('.products li').each(function(index){
jQuery(this).delay(1000 * index).removeAttr('style');
});
});
<div class="clsbb">close</div>
<ul>
<li style="margin-top:10px;">row2</li>
<li style="margin-top:10px;">row2</li>
<li style="margin-top:10px;">row2</li>
<li style="margin-top:10px;">row2</li>
<li class="new-rows">popup</li>
</ul>
need help to fadeout popup first then removeAttr