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

317
Views
Problem with different divs size and infinity scroll

django/bootstrap/infinity scroll(https://infinite-scroll.com)

I want to add infinity scroll to my news page. Queryset with 2 types of news, big(col-lg-8) and small(col-lg-4). Now I have problems with blocks (see example picture). How to make pagination page added to the previous page row?

Example

 <div class="container">
 <div class="article-feed">
     <div class="row iscroll">
    {% for art in all %}
     {% if art.banner_page %}
<div class="col-lg-8 mb-2 mt-2">
<img class="card-img-top" src="{{art.banner.url}}" >
</div>
   {% else %}
 div class="col-lg-4 mb-2 mt-2 ">
 <img class="card-img-top" src="{{art.banner.url}}" >
 </div>

         {% endif %}{% endfor %}



 <p class="pagination">
 <a class="pagination__next" href="?page={{ page_obj.next_page_number }}">
 </a></p>



 <script src="{% static "js/infinite-scroll.pkgd.min.js" %}"></script>
   <script>
 $('.article-feed').infiniteScroll({
   path: '.pagination__next',
   append: '.iscroll',
 });
   </script>
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!