Menu
PHP BABA LOGO
  • Home
  • About
PHP BABA LOGO

Lazy loader/Infinite Scroll Pagination Using Laravel & jScroll – Laraget

Posted on July 20, 2019September 7, 2025

Instead of having to click a link to get to the next set of content, infinite scrolling (also known as lazy loading, endless scrolling, autopager, endless pages, etc.) pulls the next content automatically into view when the reader approaches the bottom of the page.

If you want to implement infinite scroll pagination using Laravel, get the jScroll (a jQuery plugin written by Philip Klauzinski) include in page.

Add this code in your page

 

<\script type=”text/javascript”>
// jquery.jscroll.js using for auto scroll
$(‘ul.pagination’).hide();
$(function() {
$(‘.infinite-scroll’).jscroll({
autoTrigger: true,
autoTriggerUntil: false,
loadingHtml: ‘<img class=”center-block” src=”‘+base_url+’/img/loading.gif” alt=”Loading…” />’,
padding: 0,
nextSelector: ‘.pagination li.active + li a’,
contentSelector: ‘div.infinite-scroll’,
callback: function() {
$(‘ul.pagination’).remove();
}
});
});
<\/script>

Also apply “infinite-scroll” class on the foreach loop

<\div class=”infinite-scroll”>
@foreach ($products as $item)
— —

@endofrech
<\/div>”

 

 

Categories

  • Docker
  • Git
  • Interview Questions
  • Laravel
  • Linux
  • php
  • Salesforce

Recent Posts

  • Salesforce interview question
  • Platform Developer I Certification Maintenance (Winter ’25)
  • Batch Class in Salesforce
  • Platform Developer I Certification Maintenance (Winter ’24) Get Hands-on with Bind Variables in a SOQL Query
  • How to check Salesforce current release version

Recent Posts

  • Salesforce interview question September 7, 2025
  • Platform Developer I Certification Maintenance (Winter ’25) July 16, 2025
  • Batch Class in Salesforce January 25, 2024
  • Platform Developer I Certification Maintenance (Winter ’24) Get Hands-on with Bind Variables in a SOQL Query December 19, 2023
  • How to check Salesforce current release version January 12, 2023
©2025 The Tech Paper | Powered by Abhinav Trivedi