Jquery каждую итерацию цикла

Возможно ли, чтобы jquery каждый цикл начинался с индекса 20 после нажатия кнопки «Загрузить больше»? я не могу понять это правильно, потому что цикл каждый раз начинается с 0....

С уважением,

Стефан

after:function() {
    var images = $("#instafeed").find('a');
    var len = images.length;

    $.each(images, function(index, image) {
      var delay = (index * 75) + 'ms';
      $(image).css('-webkit-animation-delay', delay);
      $(image).css('-moz-animation-delay', delay);
      $(image).css('-ms-animation-delay', delay);
      $(image).css('-o-animation-delay', delay);
      $(image).css('animation-delay', delay);
      $(image).addClass('animated flipInX');   
    }); 

    $('#loadmore').click(function(e){
      e.preventDefault();
      index = 20;
      feed.next();
    });
}

person amorz    schedule 03.06.2015    source источник
comment
stackoverflow.com/questions/4760734/   -  person AmmarCSE    schedule 03.06.2015


Ответы (1)


Конечно, просто нарежьте коллекцию jQuery.

$.each(images.slice(20), function(index, image) { ...
person adeneo    schedule 03.06.2015