Load List Items dynamically with JQuery

后端 未结 6 1891
伪装坚强ぢ
伪装坚强ぢ 2021-01-14 13:58

I\'d like to structure my JQuery to fade in each individual item at a time. Here\'s an example of the behavior, and here\'s the JQuery I have so far:

$(\'li\         


        
6条回答
  •  臣服心动
    2021-01-14 14:48

    Loop through the li, and use setTimeout to queue the animation for that li.

    $('li').each(function () {
        var li = this;
        animateLi = function () {
            li.fadeIn(800);
        }
        setTimeout(animateLi, timeout);
        timeout += 100;
    });
    

提交回复
热议问题