How can I delay each()
from being triggered?
This is the code that delays each box from fading out at certain time given.
$(document).ready(function(){
var delay = 0;
$('.block-item:lt(16)').each(function(){
//^^ do for every instance less than the 16th (starting at 0)
$(this).delay(delay).animate({
opacity:0
},500);
delay += 500;
});
});
But I want to delay about five second before the each()
is triggered. Is it feasible?
Here is the link.
If it is just a matter of delaying the initial animation, why not just start with a 5000 delay?
$(document).ready(function(){
var delay = 5000;
$('.block-item:lt(16)').each(function(){
//^^ do for every instance less than the 16th (starting at 0)
$(this).delay(delay).animate({
opacity:0
},500);
delay += 500;
});
});