simplePagination preventDefault on page click

1.2k Views Asked by At

I'm using this plugin to create a pagination. On page click I have my function but I don't want the page to add #page-1 to the URL. How can I prevent that?

preventDefault not working because I can't catch the event.

$('#pagination').pagination({
    items: items,
    displayedPages: 3,
    edges: 1,
    onPageClick: function(pageNumber) {
        // my function
    }
);
1

There are 1 best solutions below

0
Navid On

it is so simple!

 onPageClick: function (page, event) {
    event.preventDefault() 
  // my function
 }