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
8
votes
2 answers

GridView with infinite scroll optimization

I've created a simple app that fetches images from Pixabay and then displays them in a GridView with infinite scroll. My OnScrollListener: public class BasicOnScrollListener implements AbsListView.OnScrollListener { private IOnScroll…
8
votes
4 answers

Ionic 3 Infinite Scroll 'cannot read property timestamp of null'

So I am using infinite scroll to load a very large reactive form in bits. However I've noticed that if a form input event is triggered while the infinite scroll is loading other items this happens. ERROR TypeError: Cannot read property…
Ada Orajiaku
  • 146
  • 1
  • 4
8
votes
2 answers

Endless load more recyclerview inside nested scroll android

I have Recyclerview inside the nestedscrollview and I want to scroll the nestedscrollview to the buttom display loading and load more list to recyclerview. Here is my xml.
8
votes
2 answers

Scroll Function Firing Multiple Times Instead of Once

I am trying to create a website that automatically scrolls to each section upon a single scroll action. This means that the code has to check if the page is scrolled up or scrolled down. I believe the code below solves my problem but the scroll…
Andrew Denaro
  • 163
  • 1
  • 1
  • 4
8
votes
1 answer

Why is the height of content loaded through AJAX infinity scroll not measured correctly after loading?

I am loading posts composed of pictures or videos into the main div of my website with infinity scroll (implemented through AJAX). The system works pretty much like on any popular meme website. The Problem: Each post has a body section on the left…
PeterTheLobster
  • 1,386
  • 16
  • 33
8
votes
3 answers

Infinite Scroll on iOS with Swift

I'm an iOS newbie and I would like to know how to detect when the user scrolls and reaches the bottom of an UITableView so I can load new data into the table. I would also like to know where such a method should be implemented (the tableview's class…
Luca Boieru
  • 2,260
  • 4
  • 17
  • 15
8
votes
1 answer

Passing variable through URL with angular js

I am using angular to make an e-commerce, and I'm setting an infinite scroll to the products list page. Everything worked fine, but I want to use the URL to set the page, so the user can access an specific page through URL. how do I set a variable…
Daniel Ortiz
  • 901
  • 2
  • 7
  • 14
8
votes
1 answer

Two methods of looping through Ajax requests for jQuery Then When - which to use?

I've got a deceptively simple blog project in the works, where I'm trying to bring together Isotope Jquery (for layout/filtering/sorting), Infinite Scroll, and dynamic loading of all blog excerpts via Ajax (so filtering and sorting is applied to all…
Isaac Gregson
  • 1,999
  • 1
  • 21
  • 31
8
votes
2 answers

Best pattern for pagination for Meteor

Pattern for pagination is currently on a after 1.0 roadmap for Meteor. Are there any examples or suggestions how to do it now? So how to nicely do an infinite scroll by subscribing to new and new elements as user is scrolling to the bottom?
Mitar
  • 6,756
  • 5
  • 54
  • 86
8
votes
4 answers

jQuery infinite-scroll Not Triggering

I'm making a simple little website to apply a different formatting style to Reddit posts, I'm trying to add the infinite-scroll jQuery plugin but it doesn't do anything. I tried following the (very simple) instructions on the infinite-scroll page…
Joshua Walsh
  • 1,915
  • 5
  • 25
  • 50
8
votes
1 answer

UITableView keep the scroll at the correct position while updating NSFetchedResultsController

I am developing an iOS application that mainly use a UITableView. It retrieves pages of articles from a server. We have got >25000 articles; so I have implemented a pull-to-refresh and infinite scrolling to travel across the title collection. The…
7
votes
5 answers

Is there an infinite scroll plugin with a load more button?

Where can I get the infinite scroll plugin that has a button you click before it loads in more posts? Here is what I'm looking for (look at the more button in the lower right corner)
Hellodan
  • 1,158
  • 4
  • 18
  • 38
7
votes
1 answer

React InfiniteScroll in a scrollable component on the page

I am trying to build an infinite scroll in a div with a fixed height and a scroll attached to it, so my goal is for the window not to move but a component within to have a scroll and the items within to be added infinatly. this is what i have so…
user1
  • 599
  • 1
  • 3
  • 20
7
votes
0 answers

Implementing infinite scroll in React with Apollo Client

In my NextJS app, I have a PostList.jsx component that looks like this: import { useQuery } from '@apollo/react-hooks'; import Typography from '@material-ui/core/Typography'; import { NetworkStatus } from 'apollo-client'; import gql from…
TheLearner
  • 2,813
  • 5
  • 46
  • 94
7
votes
4 answers

Pagination with Firebase firestore - swift 4

I'm trying to paginate data (infinitely scroll my tableview) using firestore. I've integrated the code google gives for pagination as best I can, but I'm still having problems getting the data to load in correctly. The initial set of data loads into…
yambo
  • 1,388
  • 1
  • 15
  • 34