A class that appends the data when end checker is visible
npm install --save @ansrlm/infinitescroll
const infiniteScroll = new InfiniteScroll({
scrollContainer: document.querySelector('.scroll'),
listContainer: document.querySelector('.list'),
endChecker: {
container: document,
targetClass: 'loading_bar',
},
fetchData,
callbackFetchData,
options: { type: 'append', expandSize: 15 },
});
infiniteScroll.mount();
Here is the demo of infinitescroll
<a href="ansrlm.github.io/infinitescroll" />
Soon be added failback function on infinitescroll v1.1.0
Then infinitescroll will support react framework
The module infinitescroll needs the following libraries.
@egjs/visible : 2.2.0+
MIT © ansrlm