Open Farshan opened 4 years ago
Hi - This issue isn't related to the script, however, to enable this on click. You'll need to declare a function in the onPageClick
option. See Available Options for onPageClick
For example
$('#selector').pagination({
items: numOfItems,
itemsOnPage: postsPerPage,
currentPage: currentPageNum,
displayedPages: 4,
onPageClick: function () { // <------ you can add a function to onPageClick
window.scrollTo({top: 0, behavior: "smooth"}); // this is the line which will execute on page click.
},
});
I have some products in my page, when I am clicking on next page, webpage is not scrolling on top. It just goes half the webpage. please help me out. thank you.