1.0.1 • Published 5 years ago

@p3kb/paginate v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@p3kb/paginate

npm (scoped) GitHub license npm bundle size (minified)

Lightweight pagination for jquery

Install

npm i @p3kb/paginate

Usage

window.pager = require('@p3kb/paginate');

//Basic
pager.paginate();

//Default options
pager.paginate(
    {
        pagination_element: '.pagination',
        previous: 'Previous',
        next: 'Next',
        num_pages: 10,
        current_page: 1,
        show_page_links: 5,
        call_as_url: true,
        to_call: window.location.href + '?page='
    }
);

//URL to change page
pager.paginate(
    {
        call_as_url: true,
        to_call: window.location.href + '?page='
    }
);
    
//Call a function to change page
function change_page(page) {
    //
}

pager.paginate(
    {
        call_as_url: false,
        to_call: 'change_page'
    }
);