Trying to make a Jquery function work

What I want to take as a trigger is if it is visible or not on the page, on the screen depending on the position of the scroll bar:
As initial triggering event-handlers?
https://www.wix.com/velo/reference/$w/postpage/onviewportenter
https://www.wix.com/velo/reference/$w/postpage/onviewportleave

You scroll your site where you have your elements on.
When one of your elements reaches/gets the → “viewportEnter” → do something?