/lib-paginator

Primary LanguageHTMLGNU Affero General Public License v3.0AGPL-3.0

Vanilla JS Pagination

Description

This is a very barefoot pagination lib, functioning as a boilerplate for your pagination usage. Style to your own liking, feel free to edit the lib (it is very small). Animation possible using the opacity of the item or edit the script to provide other animations. ES6 syntax is provided in the script.

Simple usage:

  1. Import script using <script src="PATH_TO/pagination.js"></script>
  2. Initialize the pagination:
    <script>
        document.addEventListener('DOMContentLoaded', () => {
            new Paginator('.item', '.paginationlist', 10).init();
        })
    </script>
  1. Provide an item selector, a ul selector (put empty ul-tag with a class in your html) and a displayCount (how many items you'd like to display)
  2. Style it