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

How to handle new data addition on infinite scrolling DOM

I had a question where I thought I needed some expert advice. I have an infinitely scrollable div which is loaded by a list, 10 at a time. Everything works fine if there are no changes in the list. I have a form which prepends the list with a new…
Vishal Sharma
  • 2,276
  • 16
  • 34
0
votes
2 answers

JS Code to scroll a webpage not working

I am trying to automate the scrolling down of the webpage using the following JS code window.scrollTo(0,document.body.scrollHeight); However, instead of scrolling down the page, it is scrolling up. Webpage in question is -…
pb_ng
  • 341
  • 4
  • 17
0
votes
3 answers

How to detect position of the Bootstrap modal scrollbar?

I'm using JQuery and Bootstrap and I'm loading a modal with an ajax request, so content will be loaded dynamically inside of the modal. I managed to load more content with a button click (also inside the modal), but I wanted to implement a infinite…
0
votes
1 answer

How to scroll specified infinite scroll element in Selenium with Python

I'm new to Selenium and not familiar with JavaScript. I'd like to get news links from Top Stories in this link. therefore, I have to scroll only that container which includes headlines. I am using Selenium with Python. My code is from selenium…
mk_sch
  • 912
  • 1
  • 11
  • 26
0
votes
2 answers

Repeatedly scroll infinite scrolling page with jquery

I want to repeatedly scroll to the bottom of the page and back up every 40ms. $("html, body").animate({ scrollTop: $(document).height() }, 400); setTimeout(function() { $('html, body').animate({scrollTop:0}, 400);…
horse
  • 1
0
votes
1 answer

Angular infinite scroll adding broken directive templates every time it gets new data

I am working on a social feed that displays charitable activities. It's supposed to look like the second activity in this image: But as you can see, every time that angular-infinite-scroll goes to fetch the next batch of activities, it adds a…
ClaytonAlanKinder
  • 193
  • 1
  • 3
  • 13
0
votes
1 answer

Make a jquery 1.8 script to use jquery 3.x

I have a script infinite-scroll which was build with jquery 1.8.3 but it does not work on the site which is using jquery 3.1.1, I need this script to start using 3.1.1 because my site bootstrap modal uses 3.1.1 and i cannot drop the 3.1.1. here is…
JSking
  • 329
  • 1
  • 3
  • 16
0
votes
0 answers

infinite scroll - python

I am scraping a site using selenium. The site uses infinite scrolling, so I am trying to use selenium to scroll down and get more search results than those served after the first request. I adapted the following, excellent script: crawl site that…
Alejandro Simkievich
  • 3,014
  • 3
  • 26
  • 44
0
votes
1 answer

Scraping the content of a box contains infinite scrolling in Python

I am new to Python and web crawling. I intend to scrape links in the top stories of a website. I was told to look at to its Ajax requests and send similar ones. The problem is that all requests for the links are same:…
mk_sch
  • 912
  • 1
  • 11
  • 26
0
votes
0 answers

Infinite Scroll with Laravel 5 on Dynamic Search Results Page

I'm tried to display page with infinite scroll on Laravel 5. I can't append my filter keys and split again. My javascript file: var win = $(window); var paginate = 0; win.scroll(function() { if ($(document).height() - win.height() ==…
Rys
  • 450
  • 1
  • 6
  • 18
0
votes
2 answers

how to edit? infinite recycleview

i'm making infinite recycleview with json. this code works only half i can see items loaded at first time. but when i scroll down, nothing happen, i guess, maybe onLoadMore() is not working. i been edited 4hours direct me where should i edit? thank…
user3662974
  • 75
  • 1
  • 3
  • 9
0
votes
1 answer

How to cache a page using AngularJS RouteProvider?

I have a standard Master > Details page in AngularJS setup using RouteProvider. The Master page has a variation of "infinite scrolling" where Data can be added AND removed at both ends. Say, the user is looking at Contacts list, and has scrolled to…
0
votes
2 answers

How to infinite horizontal scroll an image in jQuery?

Im trying to layer 2 images 1 on top of the other and make them scroll infinitely using jQuery. I am able to make the images scroll and layer in CSS but the animation becomes very jerky. How could I create an infinite horizontal scroll on an image…
kevinabraham
  • 1,250
  • 3
  • 19
  • 49
0
votes
0 answers

Infinite Scroll triggred multiple times

I make an app based on ionic 2 that use the Infinite Scroll. I got a little problem.. The event triggred multiple times that make my app not working well Here's the code on the component for Infinite scroll doInfinite(infiniteScroll) { this.page…
0
votes
0 answers

Add a new div dinamically on scroll(infinite scroll page) and verify if this div exists already

I have a little issue with my script. I want to add the div #widget-thumbnails but when i scroll this div is adding always and always on t[0] not on an other div where this div does not exist yet. I don't want to use jQuery for this script. If you…
Chris C
  • 1
  • 3