Implementing a continuous scroll

Social websites often have the feature of continuous scrolling, which is also known as infinite scrolling. There are long lists of items and as you scroll the page down, new items are loaded and attached to the bottom automatically. In this recipe, we will see how to achieve such an effect with Django and the jScroll jQuery plugin. We'll illustrate this using a sample view showing the top 250 movies of all time from Internet Movie Database (http://www.imdb.com/).

Getting ready

First, download the jScroll plugin from the following link: https://github.com/pklauzinski/jscroll.

Put the jquery.jscroll.js and jquery.jscroll.min.js files from the package in the myproject/site_static/site/js/ directory.

Next, for this example, ...

Get Web Development with Django Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.