user2587454
user2587454

Reputation: 913

simplePagination preventDefault on page click

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
    }
);

Upvotes: 2

Views: 1368

Answers (1)

Navid
Navid

Reputation: 609

it is so simple!

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

Upvotes: 1

Related Questions