Load List Items dynamically with JQuery

后端 未结 6 1821
伪装坚强ぢ
伪装坚强ぢ 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:29

    Here is how you do it:

    var delay = 200, t = 0;
    $("li").css('display', 'none').each(function(){
        t += delay;
        var $li = $(this);
        setTimeout(function(){
            $li.fadeIn(1900);
        },t);
    });
    

提交回复
热议问题