Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

JavaScript Scroll Pagination (Infinite Scroll)

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Sample Code:

<!DOCTYPE html>
<meta charset="utf-8">
<title>Scroll Pagination</title>
<link rel="stylesheet" href="assets/scroll-pagination.css">
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="scroll-pagination.js"></script>

    YUI().use("scroll-pagination", function (Y) {

        var scroll = new Y.ScrollPagination({
            foldDistance: 500,
            delay: 1000,
            data: {
                source: "ajax.php",
                schema: {
                    metaFields: {
                        count: "result.count",
                        last_id: "result.last_id",
                        last_timestamp: "result.last_timestamp",
                        html: "result.html"
                request: "?page=1&r=" + parseInt(new Date().getTime(), 10)

        scroll.on("load", function (e) {

            // Set for next request.
            self.set("data.request", [
                "?last_id=" + data.last_id,
                "&last_timestamp=" + data.last_timestamp,
                "&page=" + page

            // Inject HTML.

Something went wrong with that request. Please try again.