Transform any Drupal pager into an autopager - infinite scroll pager - load more pager

Convert any pager (views, search, ...) to an autoloading endless scroll autopager with just a few lines of code.

Step 1:

Download the file jquery.infinitescroll.min.js from https://github.com/paulirish/infinite-scroll and put it in /sites/all/themes/YOURTHEME/js/jquery.infinitescroll.min.js.

If you are using responsive design with flexible images (and thus no width/height in the html), it is recommended to also add the imagesloaded plugin to be sure your images have a width and height before they get added. Add the file jquery.imagesloaded.min.js from https://github.com/desandro/imagesloaded. If you don't install this plugin you need to remove the $container.imagesLoaded( function(){ wrapper from the examples below.

Step 2:

Add the js file to the info file of your theme

Step 3:

Make a custom javascript file /sites/all/themes/YOURTHEME/js/YOURTHEME.js with contents (Drupal 6).

Drupal 6 code


/**
* Implementation of autopager @see https://github.com/paulirish/infinite-scroll
* All views that have the "autopager" class will have an autopager
*/
Drupal.behaviors.viewsInfiniteScroll = function(context) {
$(function(){

var $container = $('div.autopager div.view-content');

$container.imagesLoaded( function(){
$container.infinitescroll({

Subscribe with RSS Subscribe to RSS - autopager