# metafizzy/infinite-scroll

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/metafizzy-infinite-scroll).**

7,489 stars · 1,697 forks · HTML · MIT

## Links

- GitHub: https://github.com/metafizzy/infinite-scroll
- Homepage: https://infinite-scroll.com
- awesome-repositories: https://awesome-repositories.com/repository/metafizzy-infinite-scroll.md

## Topics

`ajax` `javascript-plugin` `jquery-plugin` `ui`

## Description

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.

## Tags

### User Interface & Experience

- [Infinite Scrolling](https://awesome-repositories.com/f/user-interface-experience/infinite-scrolling.md) — Implements the infinite scrolling UX pattern that automatically loads content as the user scrolls.
- [Loading](https://awesome-repositories.com/f/user-interface-experience/buttons/loading.md) — Provides a button that loads the next page on click with loading and last-page states. ([source](https://v3.infinite-scroll.com/))
- [Page Loading Buttons](https://awesome-repositories.com/f/user-interface-experience/buttons/loading/page-loading-buttons.md) — Provides a button that loads the next page of content on click with loading and last-page states. ([source](https://infinite-scroll.com/options))
- [Scroll-Based Pagination](https://awesome-repositories.com/f/user-interface-experience/scroll-based-pagination.md) — Fetches and inserts subsequent pages of content triggered by scroll position or button click.
- [Infinite Scroll Triggers](https://awesome-repositories.com/f/user-interface-experience/scroll-containers/custom-scroll-triggers/infinite-scroll-triggers.md) — Automatically fetches and appends the next page of content when the user scrolls near the bottom of a container.
- [URL Update Scroll Preservers](https://awesome-repositories.com/f/user-interface-experience/scroll-interaction-handlers/scroll-state-controllers/scroll-restoration/scroll-position-maintenance/url-update-scroll-preservers.md) — Updates the URL as the user scrolls so that refreshing or returning to a page restores the exact scroll position. ([source](https://v3.infinite-scroll.com/))
- [Masonry Layouts](https://awesome-repositories.com/f/user-interface-experience/layout-containers/masonry-layouts.md) — Works with Masonry, Isotope, and Packery to append new items into a visual grid layout. ([source](https://v3.infinite-scroll.com/))
- [Layout Library Integrations](https://awesome-repositories.com/f/user-interface-experience/layout-containers/masonry-layouts/layout-library-integrations.md) — Integrates with Masonry, Isotope, and Packery to append new items into visual grid layouts.
- [Masonry Layout Integrations](https://awesome-repositories.com/f/user-interface-experience/layout-containers/masonry-layouts/masonry-layout-integrations.md) — Automatically appends new items into Masonry, Isotope, or Packery visual grid layouts after page loads.
- [Layout Integration Utilities](https://awesome-repositories.com/f/user-interface-experience/layout-integration-utilities.md) — Adds appended items to Masonry, Isotope, or Packery layouts automatically. ([source](https://infinite-scroll.com/options))
- [Last Page Detectors](https://awesome-repositories.com/f/user-interface-experience/pagination-navigation/first-last-page-navigation/last-page-detectors.md) — Checks if the last page has been reached to prevent further requests and trigger a last event. ([source](https://infinite-scroll.com/options))
- [Scroll Trigger Distance Configurators](https://awesome-repositories.com/f/user-interface-experience/scroll-containers/custom-scroll-triggers/scroll-trigger-distance-configurators.md) — Configures the distance from the viewport to the scroll area that triggers loading the next page. ([source](https://infinite-scroll.com/options))

### Part of an Awesome List

- [Loading and Status Indicators](https://awesome-repositories.com/f/awesome-lists/devtools/loading-and-status-indicators.md) — Shows status elements for request, last page, and error states during page loading. ([source](https://infinite-scroll.com/options))
- [Page Index Tracking](https://awesome-repositories.com/f/awesome-lists/devtools/carousel-and-gallery/index-navigation/page-index-tracking.md) — Reports the number of the currently loaded page, automatically determined from the path or URL. ([source](https://infinite-scroll.com/api))

### Development Tools & Productivity

- [History State Updates](https://awesome-repositories.com/f/development-tools-productivity/change-tracking/state-tracking-utilities/state-history-buffers/browser-history-state-caching/history-state-updates.md) — Updates the browser URL and history state as new pages load, preserving scroll position.
- [DOM Content Appenders](https://awesome-repositories.com/f/development-tools-productivity/dom-content-appenders.md) — Inserts selected elements from the loaded page into the container, with an option to disable appending for custom behavior. ([source](https://infinite-scroll.com/options))

### Programming Languages & Runtimes

- [Scroll-Based Resource Loading](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-class-creation/class-loading-mechanisms/lazy-loading/scroll-based-resource-loading.md) — Automatically fetches and appends the next page of content when the user scrolls near the bottom of the container. ([source](https://infinite-scroll.com/demo/full-page))
- [Scroll Loading Toggles](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-class-creation/class-loading-mechanisms/lazy-loading/scroll-based-resource-loading/scroll-loading-toggles.md) — Enables or disables loading the next page when the user scrolls past the threshold. ([source](https://infinite-scroll.com/options))

### Software Engineering & Architecture

- [Sequential Page Navigators](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/frontend-rendering-loading/page-navigation-prefetching/paging-library-data-loading/sequential-page-navigators.md) — Updates the next page URL from the loaded page's content, enabling a chain of linked pages to be loaded automatically. ([source](https://infinite-scroll.com/extras))
- [Button-Triggered Page Loads](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/frontend-rendering-loading/page-navigation-prefetching/paging-library-data-loading/button-triggered-page-loads.md) — Provides a button-triggered mode for loading subsequent pages of content.
- [Manual Page Loaders](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/frontend-rendering-loading/page-navigation-prefetching/paging-library-data-loading/manual-page-loaders.md) — Triggers loading and appending the next page of content, returning a promise after items are appended. ([source](https://infinite-scroll.com/api))

### Web Development

- [History State Updaters](https://awesome-repositories.com/f/web-development/browser-history-management/history-state-updaters.md) — Updates the browser URL and history entries using replaceState or pushState as new content is loaded.
- [Automated Content Loading](https://awesome-repositories.com/f/web-development/custom-page-frameworks/page-content-injections/pagination-navigators/pagination-crawlers/automated-content-loading.md) — Automatically fetches and appends the next page of content when the user scrolls near the bottom of a container. ([source](https://infinite-scroll.com/demo/full-page/))
- [Embedded Browser URL Loads](https://awesome-repositories.com/f/web-development/custom-page-url-resolution/embedded-browser-url-loads.md) — Changes the browser's URL and history entry to reflect the current page as new content is loaded. ([source](https://infinite-scroll.com/demo/full-page))
- [Next Page URL Pattern Resolvers](https://awesome-repositories.com/f/web-development/custom-page-url-resolution/next-page-url-pattern-resolvers.md) — Determines the URL for the next page using a selector, template string with placeholders, or custom function. ([source](https://infinite-scroll.com/options))
- [URL Pattern-Based Loading](https://awesome-repositories.com/f/web-development/dynamic-content-loading/url-pattern-based-loading.md) — Determines next page URLs from selectors, templates, or custom functions to load sequential content.
- [Browser History API Updates](https://awesome-repositories.com/f/web-development/event-interception-frameworks/url-change-interceptors/browser-history-api-updates.md) — Changes the page URL and browser history using replaceState or pushState as content is loaded. ([source](https://infinite-scroll.com/options))
- [Pattern-Based URL Rewriting](https://awesome-repositories.com/f/web-development/url-construction/url-component-deconstructors/url-component-replacements/pattern-based-url-rewriting.md) — Determines the next page URL using a selector, template string with placeholders, or custom function.
- [Analytics Tracking](https://awesome-repositories.com/f/web-development/analytics-tracking.md) — Ships built-in pageview tracking to Google Analytics on each content load.
- [Pageview Tracking](https://awesome-repositories.com/f/web-development/analytics-tracking/pageview-tracking.md) — Sends pageview events to Google Analytics each time new content is loaded via infinite scroll. ([source](https://infinite-scroll.com/extras))
- [JSON APIs](https://awesome-repositories.com/f/web-development/json-apis.md) — Fetches JSON data from an API endpoint and appends returned items as the user scrolls. ([source](https://infinite-scroll.com/extras))
- [Element Scrolling Utilities](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-interaction-primitives/element-scrolling-utilities.md) — Sets a specific element as the scroll container instead of the window for overflow scrolling. ([source](https://infinite-scroll.com/options))

### Content Management & Publishing

- [Next Page URL Resolvers](https://awesome-repositories.com/f/content-management-publishing/page-media-managers/url-path-construction/next-page-url-resolvers.md) — Returns the relative or absolute URL path for the next page to be loaded. ([source](https://infinite-scroll.com/api))

### Data & Databases

- [Prefill Loaders](https://awesome-repositories.com/f/data-databases/on-load-data-fetchers/prefill-loaders.md) — Loads and appends pages on initialization until the scroll requirement is met. ([source](https://infinite-scroll.com/options))
