How can I make pagination to show results at the top of the repeater and not at the bottom of the webpage?
I’m new to Wix and code. I’m using the Wix Editor for my website.
It is a simple one-page without a header and footer. Image section, Two dropdown fields to filter results from the repeater and the pagination.
I’m hoping this is the right code if not I will be happy for guidance.
The code from the ON Click:
// Velo API Reference: Velo Docs
$w.onReady(function () {
// Write your Javascript code here using the Velo framework API
// Print hello world:
// console.log("Hello world!");
// Call functions on page elements, e.g.:
// $w("#button1").label = "Click me!";
// Click "Run", or Preview your site, to execute your code
});
$w(‘#pagination1’).onDblClick((event) => {
})
$w(‘#pagination1’).onClick((event) => {
})
Thank you all ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/google_classic/slight_smile.png?v=12)
Hi, Thanks for your reply. I know I can move the pagination above the repeater.
I prefer not to do it like that. I prefer to jump to the top of the repeater area.
Yes. it sounds good. Yes I need help ![:pray: :pray:](https://emoji.discourse-cdn.com/google_classic/pray.png?v=12)
can’t you post the code here?
Thanks, I replace the code or add to the code in the “on click” state?
I placed it. I got an error.
This is the website: jobshub.co.il and this is where I want it to scroll
My Error message:
deploymentId: 2b3a2a82-3d42-4a84-b2b2-2d49d7716697
12/17/2024, 4:52:35 PM
Status: Error
[/pages/Home.wsdzf.js]: public/pages/wsdzf.js: Unexpected character ‘‘’. (5:3)
3 | $w.onReady(function () {
4 | // Event listener for the pagination click
5 | $w(‘#pagination1’).onClick(() => {
| ^
6 | // Scroll to the top of the page when pagination changes
7 | scrollToTop();
8 | });
[/pages/Home.wsdzf]:
Your code is incomplete and the wrong event is being used. That is why the page does not scroll to the top after the pagination bar changes.
$w('#pagination1').onChange(() => {
$w('#someElementAtTheTopOfThePage').scrollTo();
})
@codequeen Thanks. I need to add it to the code I got from Code_Wizard ?
OK, I tried to play with the code position. Didn’t succeed. @codequeen can you please
send me the all code in one shot? can it scroll to the top of the repeater and not the top of the page? Website link: jobshub.co.il
As you can see from my reply, I highlighted a piece of your original code and simply replaced it for you. That IS the entire code.
@codequeen Yappp… You are the Queen
. Thank you. ![:pray: :pray:](https://emoji.discourse-cdn.com/google_classic/pray.png?v=12)
1 Like