Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@webcreate/infinite-ajax-scroll

webcreate566AGPL-3.0-only3.1.0

Turn your existing pagination into infinite scrolling pages with ease

infinite-ajax-scroll, infinite-scroll, infinite, endless, scroll, scrolling, ajax, pagination, ias, jquery-ias

readme

Infinite Ajax Scroll

Infinite Ajax Scroll

Turn your existing pagination into infinite scrolling pages with ease.

  • SEO friendly 🥇
  • Doesn't break browsers back button 💯
  • Highly customizable ✨

More features, documentation and examples available at: https://docs.infiniteajaxscroll.com/

npm

Installation

Use Infinite Ajax Scroll via CDN

Get up and running in no time by linking directly to Infinite Ajax Scroll on unpkg.

<script src="https://unpkg.com/@webcreate/infinite-ajax-scroll@^3/dist/infinite-ajax-scroll.min.js"></script>

Place this code right before the </body> tag on each template or page that you want to use infinite scroll on.

Manage as a package

Are you using NPM in your projects? You can install and update our package easily.

$ npm install --save @webcreate/infinite-ajax-scroll

Usage

Infinite Ajax Scroll works on a container with item elements which get appended. A next link is used to determine the next url.

<div class="container">
    <div class="item">...</div>
    <div class="item">...</div>
    <div class="item">...</div>
    ...
</div>

<div class="pagination">
    <a href="page1.html" class="prev">Prev</a>
    <span class="current">2</span>
    <a href="page3.html" class="next">Next</a>
</div>

Now you can configure Infinite Ajax Scroll:

// import if you use the NPM package
import InfiniteAjaxScroll from '@webcreate/infinite-ajax-scroll';

let ias = new InfiniteAjaxScroll('.container', {
  item: '.item',
  next: '.next',
  prev: '.prev',
  pagination: '.pagination'
});

Full documentation can be found at https://docs.infiniteajaxscroll.com

Licensing

Infinite Ajax Scroll is dual licensed:

  1. Under the Free Software Foundation’s GNU AGPL v.3.0; or
  2. Under an Infinite Ajax Scroll Commercial License

Buying a commercial license is mandatory as soon as you develop commercial activities distributing the Infinite Ajax Scroll software inside your product or deploying it on a network without disclosing the source code of your own applications under the AGPL license.

See https://infiniteajaxscroll.com/licenses/ for more details.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

3.1.0

This version introduces upwards scroll support (fixes #466). See upwards scroll documentation on how to use this feature.

  • Adds all features from 3.1.0-beta.1
  • Added upwards documentation

3.1.0-beta.1

This version introduces upwards scroll support (fixes #466). See documentation on the prev option on how to enable this feature.

3.0.1

  • Fixed prefill not filling past the scroll threshold

3.0.0

Changes since 3.0.0-rc.1:

  • Removed promise property on the next event (replaced by nexted event)
  • Added nexted event

This version is incompatible with previous versions. Read UPGRADE.md for upgrade instructions.

This version changes the license from MIT to GNU Affero General Public License v3.0. See LICENSE for more details.

3.0.0-rc.1

Complete rewrite of Infinite Ajax Scroll.

Key features:

  • Embraces package managers
  • Dropped jQuery dependency
  • Vanilla Javascript (ES6)
  • New and improved test suites
  • New and improved documentation and examples
  • Improved developer experience

This version is incompatible with previous versions. Read UPGRADE.md for upgrade instructions.

This version changes the license from MIT to GNU Affero General Public License v3.0. See LICENSE for more details.

2.3.1

  • Fix: noneLeft event not being triggered when there was only one page

2.3.0

  • Added new option: initialize
  • Fix: ready event to fire when ready (see commit f6b44a7)
  • Added ajaxOptions to load event (PR by campadrenalin)

2.2.3

  • Improved documentation
  • Fix: Cannot read property 'Deferred' of undefined (in jQuery noConflict mode) (fixes #188, #271, #291)

2.2.2

  • Fix: render callback is not executed when using a custom render function (fixes #198)
  • Fix: unpredictable behaviour when multiple instances used the same selectors for sub-elements (fixes #93)
  • Stop ajax responder if instance was destroyed or reinitialized

2.2.1

  • Fix: prevent multiple initialisations causing duplicate items (fixes #175, #183)

2.2.0

  • Improved documentation on delay and negativeMargin options
  • Added FAQ to support documentation
  • Added Wordpress cookbook
  • Fix: Maintain history state object when changing pages (longzheng)
  • Fix: no longer caching $itemsContainer (fixes #153)
  • Fix: really destroy instance on destroy method (fixes #160)
  • Fix: Replaced deprecated size() with .length (fixes #162)
  • Fix: Reworked binding and unbinding (fixes various issues with unbinding)
  • Fix: Bail out when device doesn't support onScroll event (like Opera Mini) (fixes #146 by fflewddur)
  • Added reinitialize method

2.1.3

  • Bug #152 Improve compatibility support when Prototype is used along with jQuery (antoinekociuba)
  • Added docs

2.1.2

  • Added htmlPrev and textPrev options to IASTriggerExtension

2.1.1

  • Changed argument of load event from url to event object
  • Fixed prev() return value

2.1.0

  • Added History extension
  • Added ready event
  • Added loaded event (load is now triggered before loading starts)
  • Added rendered event (render is now triggered before rendering starts)
  • Added priority to callbacks
  • Added initialize call for extensions
  • Added one method

2.0.0

  • Completely rewritten
  • Extensible through extensions
  • Extensible through events
  • Added an extensive test suite