jQuery-viewport-checker
Little script that detects if an element is in the viewport and adds a class to it.
Installation
Download the file located in /dist
or use bower to install it.
npm install jquery-viewport-checker
Include the script and jQuery in your website tag and call it on the elements you want to check.
Options
The currently available global options are:
;
Besides the global options you can also add data-attributes to each individual element. These attributes will override the global options.
Available attributes are:
> classToAdd > classToRemove > Removes added classes after CSS3 animation has completed > offset > repeat > scrollHorizontal
Use case
The guys from web2feel have written a little tutorial with a great example of how you can use this script. You can check the tutorial here and the demo here.