Questions tagged [infinite-scroll]

Infinite Scrolling, also known as endless scrolling, is a technique that is widely used by websites and Web applications that host lots of content on a page where pagination would traditionally have been used. Infinite scrolling involves initially loading only one page of content. As the user scrolls down, the browser fetches another page via an AJAX request. There are several Infinite Scrolling plugins that facilitate this technique in modern browsers.

Background:

In Web 1.0 applications, it is common to see pagination used to limit the browser from displaying all of the data in a set all at once. Pagination allows a subset of the data to be displayed on the page, which reduces the memory footprint and decreases the lag-time caused by too much visible markup being displayed in the DOM.

Pagination involves "next" and "prev" links as controls in which a user uses to traverse through the data. This technique is facilitated through either full page reloads, where clicking next reloads the page with the next data subset, or it's facilitated through AJAX, where the application replaces a portion of the page with the next set of data.

Some Infinite Scrolling plugins, such as the Infinite Scrolling - A jQuery Plugin simply extend this type of pagination by hiding the "prev" and "next" hyperlinks and automating the click through process by monitoring the scrollTop position, while others do not.

Thus, for websites and web applications with an existing legacy pagination technique, a plugin that extends existing functionality may be more desirable.

Example of the Infinite Scrolling Technique:

An real-life example of the infinite scrolling technique is found here

Infinite scrolling plugins:

Below is a list of some widely known Infinite Scrolling plugins:

When should I use this tag?

You should use the [infinite-scroll] tag on questions where you know or reasonably believe through trial and error that the problem you're facing is related to an infinite scroll plugin or an infinite scroll technique.

For example, this question is asked by a user who was having problems getting the jQuery Infinite Scroll plugin to work. The error the user is seeing only appears when the plugin is loaded, which implies that the plugin is involved in the problem.

It's not helpful to tag a question with a tag that isn't specifically involved in the problem, so an example of a situation where I wouldn't use the tag would be if the Infinite Scroll plugin or technique was working great, yet I had problems making an AJAX call to the server. Additionally, the problem occurs with or without the plugin; therefore, I would not use that tag in this specific scenario.

Advanced Techniques:

The majority of the Infinite Scroll plugins that exist, in general, only offer one way scrolling functionality. In other words, as the user scrolls down, more content is added. However, in most cases, the content above the visible viewing area remains actively loaded in the DOM.

As users scroll down long enough, they may begin to experience a lag as more and more memory is consumed by the browser. With enough content, this could theoretically cause a browser crash.

Ben Nadel writes a blog post covering Bidirectional Infinite Scroll. While there is no demo, in the blog post, he includes a video that demonstrates the technique.

For Bidirectional Scroll, there exists no plug-in at this time, at least none that are easy to find. The bidirectional technique is much harder to implement than the one-way technique.

The difficulty comes not from implementing two directions per se, but instead the difficulty manifests itself when attempting to implement scrolling that loads content above the visible area, such as when the user scrolls up. When scrolling down, new content added to the page does not affect the visible viewing area. While users may see the scrollbar move, the content itself is not affected.

But when content is loaded on top, the visible scroll area shifts, and the user experiences a jarring effect. Ben Nadel's technique involves storing the scrollTop position prior to loading in new content on top, and then once the content loads, a new scrollTop is quickly calculated before the user experiences any side effects.

2222 questions
0
votes
1 answer

Change Kaminari url for paginator

I have an app with a page of items that have some sort options at the top. The items are using desandro's InfiniteScroll plugin. When the page loads the infiniteScroll works fine. It grabs the URL from the paginator's next link and works…
rctneil
  • 7,016
  • 10
  • 40
  • 83
0
votes
2 answers

infinite scroll not keeping previous data

The issue I'm running into is when my scroll bar reaches near the bottom, it makes the call for the next 20 records in the result set, however, it replaces the previous 20 records with the new 20. Am I missing something with infinite scroll? Here is…
idan
  • 43
  • 6
0
votes
2 answers

Change the view text of footer itemView of recyclerview

Hi I have a condition where I have to add different viewType with text show more or loading... at the bottom of the recyclerview I have successfully added the footer view with show more and also I have added the listener on this footer item view…
Ram Mandal
  • 1,899
  • 1
  • 20
  • 35
0
votes
0 answers

Using react-infinite-scroll-component with a predefined array

I have an array called filtered which is fill with events. I am trying to implement this infinite scroll with my current array. https://www.npmjs.com/package/react-infinite-scroll-component I have the following code. const recentActivity =…
letsCode
  • 2,774
  • 1
  • 13
  • 37
0
votes
1 answer

Using Infinite scroll and History API

I'm using Infinite Scroll on my site. I have a comments feed on each post that uses infinite feed. When someone clicks on one of the comments, the comment's replies should load. When someone clicks on one of the comment's replies, then that reply…
user2896120
  • 3,180
  • 4
  • 40
  • 100
0
votes
1 answer

Scrolling with Parallax effect with CSS

I am trying to achieve parallax effect with only CSS in an infinite scrolling page which whould have a seamless repeated background pattern. The content over the background would be loaded by AJAX, so it would have an arbitrary height depending on…
0
votes
0 answers

angularJs inifinite-scroll directive - shows only first 20 rows

I am trying to use inifinite-scroll directive for angularJS. The examples show usage of div inside the div, but in my case I'm trying to use it in a table. Here is my html:
Naomi
  • 718
  • 1
  • 9
  • 28
0
votes
1 answer

Jquery, Django, Infinite Scroll load rest of elements after page is loaded

I was able to implement infinite scrolling into my Django website's home page following this guide: https://simpleisbetterthancomplex.com/tutorial/2017/03/13/how-to-create-infinite-scroll-with-django.html Basically the Jquery code that triggers the…
0
votes
1 answer

React - InfiniteScroll(react-infinite-scroller), loadMore function re-renders the whole list

I have implemented infinite scroll for one of my components. The code structure looks like this I have a parent component called , this component does the fetch call for article List. Below is the code import React, { Component } from…
0
votes
1 answer

How to implement infinite-scroll pagination in Angular7?

I have an object with params i want to send. So ngOnInit works, but what i need onScrollDown add to my params pageNumber + 1 everytime i scroll. How can i do that ? questionListParams = { pageNumber: 1, pageSize: 10, }; ngOnInit() { …
Dean Novak
  • 65
  • 3
  • 10
0
votes
1 answer

infinite scroll fire twice after 1 time scroll in Angular Js?

i have implement infinite scroll in out website but it is fire twice time after 1 time scroll.i have used infinite-scroll-disabled but its not working for me.tell me anyone how to fix scrolling issue? $scope.loadMore = function() { …
Kapil Soni
  • 1,003
  • 2
  • 15
  • 37
0
votes
1 answer

Ionic v4 infinite scroll is still visible even if all data is fully loaded

This is my first ionic application. I am adding an infinite scroll to my ionic page: doInfinite(infiniteScroll) { //this.getOrders(0, this.pageSize); setTimeout(() => { for (let i = 0; i < this.length; i++) { this.getOrders(0,…
alim1990
  • 4,656
  • 12
  • 67
  • 130
0
votes
1 answer

Ag-grid fill row after select in infinite scroll model reactjs

I use ag-grid as infinite scroll model. When i select some row, i check it in BE and after that i want to fill this row as green (in screenshot blue - it's selected row, i want to fill green this row after some action, for example, after click…
Se Br
  • 101
  • 3
  • 14
0
votes
2 answers

XHR request pulls a lot of HTML content, how can I scrape it/crawl it?

So, I'm trying to scrape a website with infinite scrolling. I'm following this tutorial on scraping infinite scrolling web pages: https://blog.scrapinghub.com/2016/06/22/scrapy-tips-from-the-pros-june-2016 But the example given looks pretty easy,…
user3303019
  • 142
  • 1
  • 11
0
votes
1 answer

Script does not work on elemets inside infinite scroll

I have introduced infinite scroll in my code and now the like script does not work: the page is refreshed when I push the like button. Like-btn script: