Viewport ads couple of extra selectors to jQuery. With these selectors you can check whether element is inside or outside of viewport.