onViewportEnter( )


Adds an event handler that runs when an element is displayed in the viewable part of the current window.

An element enters the viewport when the page is scrolled to show any part of the element. An element also enters the viewport if it was hidden or collapsed and is then shown or expanded in the viewable part of the current window. onViewportEnter() is not fired for hidden or collapsed elements even if they are scrolled into view.

You can also define an event handler using the Properties and Events panel.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:Element
Was this helpful?
Yes
No