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
10
votes
3 answers

Circular scrolling with View Pager

We have a requirement for sycing rotating wheel with sliding images. I have used ViewPager for it but after 360 degree rotation I have to start scrolling ViewPager from X = 0. Is there any ViewPager which starts from first page after scrolled to…
10
votes
3 answers

ngInfiniteScroll not working

I am trying to make ngInfiniteScroll work but in vain - Plunker. Scroll event is only triggered on page load, after that nothing seems to trigger it. Can anyone please shed some light. I tried various combinations, none…
Shyamal Parikh
  • 2,680
  • 3
  • 27
  • 66
10
votes
2 answers

What is the correct way to implement infinite scroll in knockout?

I have an array of articles in my Model and they are rendered nicely as HTML. What I want is to add some new articles when the user scrolls to the end of the page. I achieved this, but in my opinion with some really hacky behavior: all I have done…
Salvador Dali
  • 182,715
  • 129
  • 638
  • 708
10
votes
6 answers

How to get infinite scroll to work?

I'm trying to get this infinite load script to work in my project. Here's my HTML:
Forza
  • 1,517
  • 2
  • 23
  • 47
10
votes
2 answers

Binding image lazy loading to new images inserted after ajax request

I'm using Mika Tuupola's Lazy Load plugin http://www.appelsiini.net/projects/lazyload to delay loading images as you scroll down a long image gallery. The problem is after 10 images, I use infinite scrolling so I fetch the next 10 images, and append…
DelPiero
  • 419
  • 1
  • 8
  • 18
9
votes
2 answers

window.removeEventListener with a named function isn't working

I am using React and below is the code I am using to implement the infinite scroll feature. componentDidMount() { // Flag to check if the content has loaded. let flag = true; function infiniteScroll() { let enterpriseWrap =…
rash.tay
  • 3,877
  • 5
  • 33
  • 60
9
votes
1 answer

Complex continuous scroll loop

I have a code similar to:
Franckl
  • 1,173
  • 2
  • 9
  • 17
9
votes
1 answer

It is possible to move a tiled background? (infinite scroll with TileMode.REPEAT)

I am developing a game First of all my game will be very simple, so i would prefer not to use libraries or opengl or canvas, i would prefer to achieve this with simple imageviews or normal views, or at least by the simplest way possible. For example…
NullPointerException
  • 32,153
  • 66
  • 194
  • 346
9
votes
1 answer

ExtJS 4.1 Infinite Grid Scrolling doesnt work with Dynamic store using loadData

I have to load first grid panel on tab and then load data into store using loadData() function which is working fine, but now I have to integrate infinite grid scrolling with it. Is there any way to integrate infinite scrolling on fly after loadData…
Keyur Vaghani
  • 206
  • 3
  • 8
9
votes
3 answers

How to implement UITableView infinite scrolling

I need to make a dynamic UITableView that supports Infinite Scrolling in both directions. I need to make it to where it doesn't loop, rather it just keeps going in the direction since it will be dealing with dates. The tableView is going to be in a…
9
votes
3 answers

force-stop momentum scrolling on iphone/ipad in javascript

Is it possible to force-stop momentum scrolling on iphone/ipad in javascript? Extra: pretty sure this is pie in the sky, but for bonuspoints (honor and kudos), after dom-manipulation and a scrollTo applied, resume scroll with the same momentum…
Geert-Jan
  • 16,760
  • 10
  • 68
  • 121
9
votes
2 answers

Implementing Infinite Scrolling with jquery

I am working on a project that uses the jQuery Masonry and Infinite Scroll plugins to load "n" amount of pictures from instagram using their API. Looking at this short example my understanding is that I need to have before hand the html pages to be…
Bartzilla
  • 2,740
  • 3
  • 23
  • 36
9
votes
2 answers

How does Facebook achieve infinite scrolling?

My first question is how do they get this scroll bar? http://dl.dropbox.com/u/12337149/scrollbar.png I have seen it in a few places so I presume it might be in a public library? My second question relates to the infinite scrolling itself. Once…
Hoa
  • 17,944
  • 25
  • 66
  • 97
8
votes
1 answer

imagesLoaded method not working with JQuery masonry and infinite scroll

I've been using JQuery masonry and now I'm adding infinite scroll. There are images in nearly every masonry "brick" and before I was using infinite scroll the images loaded fine and everything was great. I added the next part of the javascript for…
wuliwong
  • 3,687
  • 8
  • 35
  • 60
8
votes
2 answers

Scrolling to the bottom of a div in puppeteer not working

So I'm trying to scrape all the concerts in the boxed off area in the picture below: https://i.stack.imgur.com/7QIMM.jpg The problem is the list only presents the first 10 options until you scroll down in that specific div to the bottom, and then it…