EDIT: it might also be interesting to look at Intersection Observer that is now available in several browsers, and there is also a polyfill. I have this specific need that is to trigger an event when an element becomes visible/invisible into a scrollable area. Here is the code I came to: /** * Create the […]