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
15
votes
7 answers

Infinite Scrolling Image ViewPager

As documented by Google, the Gallery class was deprecated in API level 16. This widget is no longer supported. Other horizontally scrolling widgets include HorizontalScrollView and ViewPager from the support library. So I used ViewPager as an…
Android Stack
  • 4,314
  • 6
  • 31
  • 49
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,276
  • 2
  • 15
  • 19
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,724
  • 9
  • 48
  • 73
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,303
  • 4
  • 20
  • 32
14
votes
1 answer

Infinite looping columns in both directions

I have been working on two column website, whereby when you scroll: column A goes up and column B goes down. I implemented an infinite scroll but what I am wondering is: is it possible to clone/append one column onto the other e.g. at a certain…
DBUK
  • 1,373
  • 1
  • 23
  • 41
14
votes
3 answers

trigger infinite-scroll when there's not enough content for scroll bar on page load

I'm using the great infinite-scroll plugin- http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/ But on larger screen resolutions there's not enough posts to display a scroll bar so the infinite-scroll never gets triggered. Wondered if…
Ben
  • 1,022
  • 3
  • 13
  • 23
14
votes
1 answer

What is the best way to do ajax pagination with MongoDb and Nodejs?

I have mongodb and NodeJs. The connection is done via mongoosejs. What is the best way to develop ajax infinity scroll ? Should I use limit and offset ?
Oleg Dats
  • 3,933
  • 9
  • 38
  • 61
13
votes
5 answers

Insert content at top of page without scrolling

Is there a way that I can insert content at the beginning of a webpage without causing the page to give the impression of scrolling up. I'm trying to implement something kind of like infinite scrolling but I need to be able to scroll up infinitely…
jcuenod
  • 55,835
  • 14
  • 65
  • 102
13
votes
5 answers

How do you make an infinite scroll page in Blogger?

I have a blog and would like to make it infinite scroll so you don't have to click through pages and pages of posts. Can anyone help me with the code, its in HTML according to Blogger? Thanks :-)
sj112
  • 133
  • 1
  • 6
13
votes
2 answers

crawl dynamic web page using htmlunit

I am crawling data using HtmlUnit from a dynamic webpage, which uses infinite scrolling to fetch data dynamically, just like facebook's newsfeed. I used the following sentence to simulate the scrolling down…
13
votes
6 answers

How do I let search crawlers properly index pages with infinite scroll?

I have a website on which I implement infinite scroll: when a user reaches the end of a page, an AJAX call is made and new content is attached to the bottom of the page. This, however, means that all content after the first "page break" is…
Stas Bichenko
  • 13,013
  • 8
  • 45
  • 83
12
votes
1 answer

How to run masonry only after all html5 videos are loaded with infinitescroll?

masonry infinite scroll append html5 videos overlapping i am currently using imagesLoaded library which checks whether images are loaded then calls masonry. But it was not working with html5 video tag, because of this videos gets overlapped on one…
user1642018
12
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 =…
shet_tayyy
  • 5,366
  • 11
  • 44
  • 82
12
votes
1 answer

Infinite scroll in Elm

I am building a simple application in Elm that show just a list of divs one under the other, and I would like to add infinite scroll functionality, to add new content every time the last div of the page appears in the viewport. Is there a way in Elm…
marcosh
  • 8,780
  • 5
  • 44
  • 74
12
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
  • 214,103
  • 147
  • 703
  • 753