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

Javascript "infinite" scrolling for finite content?

I have a lot of content to display on a website, such that I need to use an "infinite" scroll solution where content is loaded as the user scrolls towards the end of the currently loaded content. However, I know exactly how much data there is, and…
0xdabbad00
  • 998
  • 2
  • 11
  • 22
11
votes
3 answers

Infinite scroll on real-time data

I am trying to implement infinite scrolling in a web application, records maybe added or deleted from the server, sorted in alphabetical order of their id, also the associated data can also change at any time and I have to show the latest data. I…
Vikrant Yadav
  • 303
  • 3
  • 18
11
votes
1 answer

Allow infinitescroll.js to run X times, then load more posts

I'm using the infinitescroll.js script and it works really well. I've found out how to replace the default functionality with a load more button, using this code: $(window).unbind('.infscr'); $('.js-next-reports').click(function() { …
patrickzdb
  • 928
  • 1
  • 10
  • 26
11
votes
2 answers

Best open-source grid with smooth, infinite scrolling

When I started working on my current project I was given quite an arduous task - to build something that in essence suppose to replace big spreadsheet people use internally in my company. That's why we I thought a paginated table would never work,…
iLemming
  • 34,477
  • 60
  • 195
  • 309
11
votes
1 answer

Modify InfiniteScroll to work horizontally

I see a few posts on this topic here but couldnt quite find one that actually solves the issue im trying to handle. On my site i have pages of blog posts. i have setup infiniteScroll (https://github.com/paulirish/infinite-scroll) and it is working…
VUELA
  • 268
  • 1
  • 7
  • 22
11
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
  • 18,623
  • 16
  • 75
  • 137
11
votes
3 answers

How to capture scroll event?

I want to implement infinite scrolling. Below is a short form of my layout. Since I have some elements relative positioned the javascript scroll event does not fire. How can I fix this problem in order to get the scroll event to be fired and…
Michael
  • 32,527
  • 49
  • 210
  • 370
11
votes
2 answers

How do I save an infinite stack of AJAX content when a user leaves the page?

I'm making a website with infinite scrolling. That is, as the user scrolls to the bottom of the page, a new block of content is appended to the bottom. It's very similar to Facebook. Here's an example of 3 pages loaded: _________ | | | 0…
JoJo
  • 19,587
  • 34
  • 106
  • 162
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

Endless scroll kotlin recycling view/ListView

I am desperately trying to implement endless scrolling on an android app using kotlin. All the tutorials are either useless since they dont explain things properly. So for example: https://github.com/chetdeva/recyclerview-bindings it looks…
hansTheFranz
  • 2,511
  • 4
  • 19
  • 35
10
votes
3 answers

Restore scroll position on infinite scroll page

I have a website with an infinite scroll page, listing the newest ads. When user click on a preview of the ads it will redirect him to the product page. But when user click on back button, it can not restore scroll position. Note 1 : i will load 10…
Fakhruddin Abdi
  • 876
  • 2
  • 11
  • 25
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,988
  • 4
  • 37
  • 78
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,619
  • 3
  • 28
  • 49
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
  • 489
  • 1
  • 10
  • 21
9
votes
3 answers

Infinite List in Flutter Application

I am migrating my application from android to flutter and till now I have used ListView in a flutter. my question is, is there any specialized technique to handle a large amount of data in the flutter? for reference, you can look at android…
Kiran Maniya
  • 8,453
  • 9
  • 58
  • 81