Hello all I am wondering how does one tackle asynchronous/synchronous (not sure if this is the word for it but the opposite of simultaneous) animations with jquery?
I know of one method but it's pretty messy:
$("ul li:nth-child(1)").addClass("appear").delay(300).queue(function(next){
$("ul li:nth-child(2)").addClass("appear");
next();
})
// and so on...
So I tried utilizing a for/while loop but it doesn't seem to work. What am I missing here?
$(document).ready(function(){
var i = 1;
while (i <= $("ul li").length) {
$("ul li:nth-child(" + i + ")").addClass("appear");
i++;
}
})
link to codepen -> https://codepen.io/alexyap/pen/KqZErW?editors=1111