I am expecting when I go
$.each($(something).find(something), function(){
$(this).delay(1000).fadeOut();
});
then for each matching element I get a second of delay before it is gone. but what I get is a second of delay and then it all fades out. its 3am and I can't think. please help
This will work, call it with a jQuery object as a parameter:
function fadeAll(elems) {
var i=-1;
function next() {
i = i+1;
if (i < elems.length)
$(elems[i]).delay(1000).fadeOut(next);
}
next();
}
You can see it at work here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With