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.
- Import script using <script src="PATH_TO/pagination.js"></script>
- Initialize the pagination:
<script>
document.addEventListener('DOMContentLoaded', () => {
new Paginator('.item', '.paginationlist', 10).init();
})
</script>
- 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)
- Style it