This version is old school.
Please find jQuery plugins on npm.
jquery scenemanager
by FiNGAHOLiC
this is a simple scene manager plugin.This plugin makes easy to execute function when the top of element reaches the waypoint (default waypoint is the middle of viewport).