📎 Webclip
A super simple implementation of Infinite Scrolling
The post explains how to turn a “load more” pagination pattern into infinite scrolling with jQuery. It starts with a window scroll event that compares document height and scroll position, then triggers the pagination button when the user reaches the bottom.
Reading notes#
- The setup assumes a site with pagination and jQuery already added.
- The scroll handler uses
scrollHeightandscrollPosto detect when the page bottom is reached. - When the condition is met, it clicks
.load-more-days-button. - The author says the exact bottom check works, but it feels too strict and is unreliable on mobile.
- The revised check fires when the user is 300 pixels above the bottom of the page.
- The post ends with a complete example that combines the scroll handler, the height check, and the button click.
