Question:
Code for onClick( ) Code to Scroll Box
Product:
code to make a box scroll, and see hidden elements
What are you trying to achieve:
scroll box
What have you already tried:
different codes using chat gpt

Additional information:
I think is easy peasy but not for me.
I have a section #section26, inside with two buttons , #button1, #button2, one on each edge and a box #box28. inside of the box there is a repeater with more boxes and vectorized files inside.
I would like to type a function to slide/scroll those unseen boxes when clicking on the arrows
export function button1_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Working with the Properties & Events Panel
// Add your code for this event here:
$w(“#box28”).onClick((event) => {
let targetId = event.target.id; // “myElement”
});
}
What’s the current setup with the repeater? Are you using a dataset to populate data into the repeater? And what type of repeater is it? (List, Grid, Slide etc.).
Depending on the current setup, you might be able to do this without any code 
If you’re able to share more info, it’ll help point you in the right direction 
This section has 2 buttons and one box.
Inside of the box is the repeater.
Inside of the repeater there are boxes, and inside of each box there is a vector file and a text.
This Boxes are set all next to each other, in one line and one column.
No dataset, I just added vectorized files and text one by one.
A ‘Slideshow Repeater’ my do what you wish with inbuilt previous & next buttons which you can customise. Can do this without code, but you do need to turn on the code option before the slideshow repeater will show up in the layouts panel.
Otherwise, as @noahlovell says, a regular repeater set to slider type may do the job.
1 Like
Nope, they don’t support vectorized files as images in the product section.
Hello stevemondaymedia I tried some slideshow repeaters but they only offer to slide between different slides, not scrolling horizontally to move along the other slides. They do accept vectorized files.
I check try to change the layout but is not possible.
Any other idea??
Hi Noah! I am actually trying to do the same thing with a repeater and hoping you can help me! I can work with code but not expert by any means. I know you can use a scrollbar with a repeater but I am hoping to add buttons to have the ability to show the next card in a repeater.
I have a repeater with cards and the cards are connected to CMS dataset elements.
I have attached a screenshot.
You can connect a button with it’s action as “Next Page” - which will move it to the next 4 items. It doesn’t seem possible to load just one new item and “loose” the first of the items.
It might be possible with code, but I don’t have experience with this case
@stevemondaymedia Hi steve, I saw your response about being able to do this with buttons if you turn code on and wondering if you could help me! Thanks!
Thanks for your reply! I have tried this but it doesn’t work for me.
How do you have the dataset “Events”?
Probably I don’t know too much about CMS…
I don’t have that option.
It was a new collection I created and named Events 
I’d recommend this article to learn more about datasets - CMS: About Datasets | Help Center | Wix.com
And although these videos are a little older/use the Wix Editor, they’re a great starting point to learn the foundations of the CMS - https://www.youtube.com/watch?v=ellQoElgYUU&list=PL0y_aclKYoYjbiFKSBDKcl697SLawvHt1
Hi Noah, thanks for the information.
I have been exploring the CMS, they are great.
Still I created a category with CMS, and add a SVG file and then connected it to a stripe wix gallery (due it’s the only resource that it’s built with arrows like a carrousel)…but it didn’t showed the images.
Any other idea of what to do?
@stevemondaymedia @noahlovell