<section aria-label="First example">
<h1>Static example (html only)</h1>
<nav aria-label="Pagina navigation (static)">
<ul class="pagination">
<li class="page-item page-item-previous disabled">
<a class="page-link" aria-disabled="true" role="button" tabindex="-1">
<span aria-hidden="true"><span class="mdi mdi-chevron-left" aria-hidden="true"></span></span>
<span class="sr-only">Vorige</span>
</a>
</li>
<li class="page-item active">
<a class="page-link" href="">1 <span class="sr-only">(huidig)</span></a>
</li>
<li class="page-item">
<a class="page-link" href="">2</a>
</li>
<li class="page-item">
<a class="page-link" href="">3</a>
</li>
<li class="page-item page-item-next">
<a class="page-link" href="">
<span aria-hidden="true"><span class="mdi mdi-chevron-right" aria-hidden="true"></span></span>
<span class="sr-only">Volgende</span>
</a>
</li>
</ul>
</nav>
</section>
<section aria-label="Second example">
<h1>Dynamic example (with pagination script)</h1>
<nav aria-label="Pagina navigation (dynamic)">
<ul class="pagination" id="paginationExample">
<li class="page-item page-item-previous">
<a class="page-link" href="">
<span aria-hidden="true"><span class="mdi mdi-chevron-left" aria-hidden="true"></span></span>
<span class="sr-only">Vorige</span>
</a>
</li>
<li class="page-item page-item-next">
<a class="page-link" href="">
<span aria-hidden="true"><span class="mdi mdi-chevron-right" aria-hidden="true"></span></span>
<span class="sr-only">Volgende</span>
</a>
</li>
</ul>
</nav>
</section>
<script id="pagination-item-template" type="text/template"></script>
<script id="pagination-item-current-template" type="text/template"></script>
Based on the version from MDB:
https://mdbootstrap.com/components/pagination/#disabled-active
No additional actions, aside from the markup, are needed to use this component.
To start using this component, some JavaScript is needed to initialize it.
Underneath a jQuery example on how to initialize the search results and the search result script itself.
Both scripts need to be placed in the Additional component(s) script
section as documented in How to use.
You need to instantiate the Pagination
class with the following parameters:
Then call the show
method with the current page as a parameter to show the results.
<script>
var pagination = new nijmegen.Pagination(10, '#{page}', 5);
$(document).ready(function () {
pagination.init('#paginationExample');
pagination.show(1);
$(window).on('hashchange', function () {
var page = parseInt(window.location.hash.slice(1));
pagination.show(page);
});
});
</script>