Automatically sends ajax requests as the user scrolls an element. Provides options to control where the response is injected into the DOM (usually above a footer).
Set it up just like you would any other pagination on the server. This example is totally simplified.
<body>
<div id="navigation"> <!-- fallback navigation --> </div>
<?php include '_page.php'; ?>
<div id="footer">Blah blah blah</div>
</body>
You would do something on the server to deliver the next page.
<div class="page">
<p>I am a page <?php echo $_GET['page']; ?></p>
</div>
var lazy = new LazyPagination(document,{
url: '_page.php',
method: 'get',
maxRequests: 20,
buffer: 1000,
navigation: 'navigation', // will destroy this if javascript is enabled
inject: {
element: 'footer',
where: 'before' // will inject pages above the footer
}
});
View the MooDoc for usage and examples.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus