in-view.js is a javascript utility to get notified when a DOM element enters or exits the viewport. It's a lightweight and dependency-free.
Website Demo