Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 libraries).

Some searching turned up next to nothing, so I thought I'd ask before getting into trying to build my own solution with backbone, if it something I should build outside a backbone collection, or if someone has attempted something similar.

like image 810
blueblank Avatar asked May 23 '11 19:05

blueblank


People also ask

How do I deal with infinite scroll?

Infinite scrolling will require two key parts. One part will be a check for the window scroll position and the height of the window to determine if a user has reached the bottom of the page. Another part will be handling the request for additional information to display.

How do you implement infinite scroll in backend?

Setting up backend First create a new Node project. Open up your terminal and create a new project folder. Install the dependencies, we need express module for now. Now we have a back end simulation ready which will keep on giving us data for any page number and any page size request.


1 Answers

This blog post landed on my twitter stream recently. Looks like a very nice solution and works well on the main page. From the blog the benefits of this solution are:

  1. Preserves the back button.
  2. Does NOT use the hashbang, no matter how happy twitter engineers are with it.
  3. Gives up on infinitely scrolling if (1) is impossible.
  4. Progressively enhances: when (3) occurs, the user follows a good ol' hyperlink for more content.
like image 184
andyb Avatar answered Oct 05 '22 04:10

andyb