Infinite Scroll is a JavaScript library that automatically loads and appends the next page of content when a user scrolls near the bottom of a container, or optionally when they click a button. It provides scroll-based pagination that fetches and inserts subsequent pages of content, with URL-driven content loading that determines next page URLs from selectors, templates, or custom functions.
The library integrates with browser history, updating the URL and history state as new pages load while preserving scroll position so each page state is bookmarkable and refreshable. It is compatible with Masonry, Isotope, and Packery layout libraries, automatically appending loaded items into visual grid layouts. Infinite Scroll also supports analytics tracking, sending pageview events to Google Analytics each time new content is loaded.
Additional capabilities include loading JSON content from API endpoints, rendering embedded elements like CodePens and Tweets after new content is appended, and displaying status indicators for request, last page, and error states during page loading. The library offers instance management for accessing, reconfiguring, or destroying an Infinite Scroll instance from a DOM element after initialization.