Load List Items dynamically with JQuery

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

    Maybe something like this:

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

提交回复
热议问题