felixlberg / infinity.js

pure javascript AJAX append plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pure javascript AJAX append plugin

Load the script in your project like this <script src="infinity.js"></script>.

You can initialize the plugin with the following lines:

<script>
  var el = document.querySelector('.ajax-append');
  if (el) {
    new infinity(el, {
      navSelector: '.pagination .pager',
      nextSelector: '.pagination a.next',
      loadingSelector: '.loading',
      pageFragment: '.ajax-append',
      scrollBuffer: 200,
      scrollOnLoad: true,
      scrollOnLoadDistance: 200,
      scrollOnLoadSpeed: 500,
      onInit: function () {},
      beforeContentLoaded: function (link) {},
      afterContentLoaded: function (html) {}
    });
  }
</script>

About

pure javascript AJAX append plugin

License:Apache License 2.0


Languages

Language:JavaScript 100.0%