Viewport is a jQuery plugin to help people detect the element is currently inside, outside or partly in viewport.
You may just need to playing around with the pseudo selectors such as $(‘:in-viewport’), above-the-viewport, below-the-viewport, left, right, partly-above, partly-below, partly-left, partly-right and have-scroll.
only include 6KB viewport.js and jQuery core to get started, that’s all for today, enjoy the goodies!
Thanks Anton Zinoviev who created this viewport detect script for free and open source.
Viewport is released under MIT license.
Source: Read more about Viewport