Scrolling Event Listener

I’m very new to Velo, and it’s been awhile since I’ve done much with Javascript, but I’m trying to get back into it so please bare with me if this questing shows I know almost nothing.

I have created a basic site for my business on wix and I want to add the parallax effect to a container. from what I can tell I can’t do this with the wix web design UI so I have turned to the code. I have a function that will look up and return the current scroll position of the page when called, but I can’t figure out how to create an event listener that calls that function whenever the user scrolls the page.

Pseudo Code \//
document.addEventListener(“scroll”, (event) => {
doSomething(lastKnownScrollPosition);
});

The code below will capture the current scroll position (window.pageYOffset) and pass it to the doSomething function when the user scrolls the page.
Remember to replace doSomething with your actual function name, and you can modify the doSomething function to implement the desired parallax effect for your container.
I hope this helps! Let me know if you have any further questions.

document.addEventListener(“scroll”, (event) => {
const lastKnownScrollPosition = window.pageYOffset;
doSomething(lastKnownScrollPosition);
});