jQuery

【jQuery】ページネーションを実装。Materialize Pagination

October 12, 2016
Materialize Pagination

Materialize Paginationはページネーションを実装するjQueryプラグイン。

CSS&JS

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css" rel="stylesheet" >

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="materialize-pagination.min.js"></script>
$('#pagination').materializePagination({
    align: 'left',
    lastPage:  10,
    firstPage:  1,
    urlParameter: 'page',
    useUrlParameter: true,
    onClickCallback: function(requestedPage){
        console.log('Requested page is '+ requestedPage);
    }
}); 

Available options

Attribute Default
align 'center'
lastPage
firstPage
urlParameter 'page'
useUrlParameter true
onClickCallback {}

MITライセンス