onScroll Trigger

Does anyone have a way to access the javascript onScroll trigger? I have a vector graphic on screen to alert the user to scroll down. I want to animate this graphic using the wixAnimations API to get the user’s attention, but I only want to trigger the animation when the page hasn’t been scrolled for 10 seconds. I know you can use onViewportEnter and onViewportLeave events, but that doesn’t really work in this case.

I’ve seen posts talking about the fact that Velo can’t directly access the DOM, but I’m wondering if there is another way to do this (e.g., some Velo mixin) that I’ve overlooked.

Thanks!

You can use custom element for that.

See:

custom element on Wix
https://support.wix.com/en/article/velo-about-custom-elements

Pass data from custom element to Wix page code:
https://www.wix.com/velo/reference/$w/customelement/on

onscroll event listener
https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll

I figured a custom element may be the ticket. Thanks for the detailed response!