Reputation: 913
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
Reputation: 609
it is so simple!
onPageClick: function (page, event) {
event.preventDefault()
// my function
}
Upvotes: 1