2.0.1 • Published 1 year ago

@three11/infinite-scroll v2.0.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
1 year ago

GitHub release GitHub issues GitHub last commit Build Status npm npm Analytics

Infinite Scroll

A module for loading more items as you scroll the page down.

See a demo and the documentation.

Install

npm i @three11/infinite-scroll

or

yarn add @three11/infinite-scroll

Usage

First, import the module:

import InfiniteScroll from '@three11/infinite-scroll';

Then initialize a new instance of the module:

const infiniteScroll = new InfiniteScroll();

Settings

The default settings are:

NameTypeDescriptionDefault value
elementstringCSS selector for the items container'.js-infinite'
nextstringCSS selector for the next page link'.js-infinite__next'
itemstringCSS selector for the item which will be loaded'.js-infinite__item'
disabledClassstringClass name to add to the next page link'disabled'
hiddenClassstringClass name to add to the next page link'hidden'
responseTypeDOMParserSupportedTypeType of the AJAX response'text/html'
requestMethod'GET', 'POST', 'PUT', 'PATCH'HTTP request type'GET'
viewportTriggerPointnumberPosition in the viewport after which the loading will startwindow.innerHeight / 2
debounceTimenumberTime to wait before triggering the next loading (in ms)500
onCompletefunctionA function to run after successful loadnull

Typescript

This module offers full Typescript support out of the box.

License

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

3 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago