Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda