How to pass page number to pageClick function in Jquery-Simple pagination

Sajith picture Sajith · Oct 28, 2013 · Viewed 7k times · Source

I am using jquery simplePagination.js in my application. I created a function name showProjectPage(pageNumber). It is used to show the particular page with the page number. I used the following code for doing pagination using SimplePagination.js

$(".paging").pagination({
    items: totalItmes,
    itemsOnPage: perPageItem,
    cssStyle: 'light-theme',
    currentPage : currentPageNumber,
    onPageClick : showProjectPage
});

I can call the function usning onPageClick : showProjectPage. How can I pass the pageNumber to this function?

Answer

Roemer picture Roemer · Dec 7, 2016

I think that answer is incorrect. It needs to be:

 onPageClick : function(pageNum) {
             showProjectPage(pageNum) ;
        }

That works for me, anyway.