Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!