Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
How to make a lazy download with limited content

I need help in this matter. Now I'm studying lazy loading. And the endless scrolling turned out to be done. And in general, the code works, the content gives. But I can't figure out how to redo it so that it gives away 10 elements of, say, div's that are on the way to the URL, and if they ended there, then it would stop immersing the content of these div's. It seems to count, but I don't understand what to do with it. Maybe there was a similar topic, but I didn't find something.

function loadPageAjax(getSectionNumbers) {
  $.ajax({
    url: "lazy-page.html",
    type: "GET",
    data: { getSectionNumbers: getSectionNumbers },
    onSubmit: function ajaxViewsLoader() {
      $(".loading-icon").fadeIn();
    },
    success: function ajaxViewsSection(data) {
      $(".loading-icon").fadeOut();
      // Здесь мы получаем данные, отправленные сервером и выводим
      $(".load-wrapp").append(data);
      sectionNumber++;
      console.log(getSectionNumbers);
    }
  });
  getHeightContent = $(".load-wrapp").outerHeight();
}

$(window).scroll(function () {
  if ($(this).scrollTop() >= getHeightContent - 5) {
    loadPageAjax(sectionNumber);
  }
});  
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda