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.

1977 questions
20
votes
4 answers

Twitter bootstrap affix with infinitescroll and window.resize

From reading a few related questions on this I realize that there is no $.affix('refresh') method available at all for the twitter bootstrap affix component - my issue, although related, may be even an additional step between just a refresh, let me…
Andre
  • 670
  • 9
  • 24
19
votes
2 answers

Infinite ViewPager

This seems possible, but I'm having a little trouble figuring out how to implement a ViewPager that can page indefinitely. My use case is for a calendar that shows a month at a time, but would be able to switch to any month by paging enough…
Jon Willis
  • 6,839
  • 4
  • 38
  • 51
19
votes
3 answers

Scroll position won't reset when go to other page after pressing back button

I'm having a problem with scrolling in angularjs app. At the moment it has 2 pages: The first page is a list of customers, you can select one of them and see it's details. The second one is a list of companies, it works in the same way. I'm using a…
renchan
  • 499
  • 5
  • 23
19
votes
1 answer

Isotope v2 filtering with Infinite Scroll - Filter not finding all items and Window not resizing on filter

Head's up! There's a pending feature-request issue on Isotope's GitHub repo that you should add a "" reaction to if you're interested in seeing official docs and demos for this (how to combine Isotope, Infinite Scroll, filtering, and sorting). It…
Isaac Gregson
  • 1,325
  • 1
  • 14
  • 27
17
votes
6 answers

How to do an infinite scroll in plain Javascript

I want to avoid using jQuery or another library for the sake of keeping my code minimal, I need very little in the way of features, I just want to append to a list when the user scrolls to the bottom. How would I do this in plain Javascript?
Abhinav Sharma
  • 1,075
  • 4
  • 11
  • 12
17
votes
8 answers

swift ios add infinite scroll pagination to uitableview

I wonder if tableview has any built-in function to add infinite scroll/pagination. Right now my VC looks like this: var data: JSON! = [] override func viewDidLoad() { super.viewDidLoad() //Init start height of cell …
user2636197
  • 3,432
  • 6
  • 40
  • 64
16
votes
2 answers

Flutter GridView footer (for indicating load with infinite scrolling)

I have a GridView which works pretty smooth. I use the grid in the context of infinite scrolling where more items are loaded via a REST API whenever scrolling is close to the bottom. No problems here. However I want to be able to display a loading…
Jakob Kristensen
  • 1,077
  • 2
  • 10
  • 18
15
votes
2 answers

Angular virtual scroll: append new items when reaching the end of scroll

I would like to use virtual scroll on my Angular application. The items in my list are the result of a remote paged search. I would like to load more results (call the next page) every time I reach the end of the viewport scrolling down. Here is my…
15
votes
7 answers

How to filter a very large bootstrap table using pure Javascript

I've built a large table in bootstrap, about 5,000 rows x 10 columns, and I need to filter the table for specific attributes, fast, using only JavaScript. The table has both an id column and an attribute column, i.e. id | attr |…
vgoklani
  • 8,218
  • 11
  • 52
  • 81
15
votes
3 answers

infinite scroll manual trigger

Just doesn't seem to work... :-( Have seen more complaints about it but I can't find the answer. The Problem: Infinite scroll works but not the manual trigger. When I click the link, nothing happens. Firebug gives Infinite Scroll My code:
inTOWN
  • 980
  • 1
  • 7
  • 19
14
votes
8 answers

jquery infinite scroll "reset"

I'm using the infinite scroll jquery plugin for a website ( https://github.com/paulirish/infinite-scroll ) Everything is fine except that my page is a search so...what happen is: 1) you go on the page, browser auto-locates you and give you back a…
ricricucit
  • 2,028
  • 2
  • 14
  • 18
14
votes
6 answers

Endless/infinite scroll type solution with backbone.js

I'm toying around with backbone.js and I'm wondering if there is more concise solution for creating an 'endless-scroll' situation for models/collection than the modules I've been looking at (there are several for jquery, probably more for other…
blueblank
  • 4,064
  • 9
  • 41
  • 70
14
votes
3 answers

Angular 4: Infinite scroll not working

I have tried using ngx-infinite-scroll (https://www.npmjs.com/package/angular2-infinite-scroll) and also some other directives but none seem to work. package.json "dependencies": { "@angular/animations": "^4.0.2", "@angular/common":…
Sanchit Tandon
  • 151
  • 1
  • 1
  • 4
14
votes
2 answers

Lazy loading occasionally doesn't work in angular

I am encountering some strange behavior for the following code. function linkFunc(scope, element, attribute) { var page = angular.element($window); page.bind('scroll', function() { var windowHeight = "innerHeight"…
testing
  • 2,103
  • 2
  • 14
  • 28
14
votes
3 answers

Infinitely scrolling in both directions of UICollectionView with sections

I have a month view similar to the iOS calendar and an UICollectionView is used. Now it would be interesting to implement an infinite scrolling behavior so that the user can scroll in each direction vertically and it will never end. The question now…
testing
  • 17,950
  • 38
  • 208
  • 373