Viewport ads couple of extra selectors to jQuery. With these selectors you can check whether element is inside or outside of viewport. To see how it works check the demo.
How to use?
Viewport selectors depend on jQuery and dimensions Include both in your header:
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.dimensions.js" type="text/javascript"></script>
<script src="jquery.viewport.js" type="text/javascript"></script>
Now you can use the following new selectors
$(":in-viewport")
$(":below-the-fold")
$(":above-the-top")
$(":left-of-screen")
$(":right-of-screen")
Following diagram illustrates what will be selected. White part is visible part of your browser window. Darker green indicates area where two selectors overlap.
