June 29, 2014
isInViewport-js is an ultra-light jQuery plugin that tells you if an element is in the viewport but with a twist.
Example Code :
$( 'selector:in-viewport( tolerance[, viewport selector] )' )
This returns all the elements that are in the viewport while taking into account the tolerance criterion.
Since it returns the element(s) it can thus be chained with other jQuery methods.
When a viewport selector is specified, it uses that to calculate if the element is in that viewport or not.
When a viewport selector is not specified, it defaults to window as the viewport.
The viewport selector is any valid jQuery selector.
Created by Mudit Ameta
© 2013 jquer.in
Curated By Jay Kanakiya