Installation


Include JS

Include Snap.svg 0.4.1 and snap-animation-states.js in the footer. No JQuery needed.

<script type="text/javascript" src="js/snap.svg.js">
<script type="text/javascript" src="js/snap-animation-states.js">

Set HTML

Your SVGs need a container element. You just need to add whatever class you're calling your svg with to the element that will contain it.

<i class="icon-hamburger"></i>
<i class="my-svg-selector"></i>

Call the plugin

It's as simple as calling the plugin with the correct schema.

(function() {
SnapStates({ ...schema... })
})();

Schema


Gulp


Interested in building your own animated svg library? Check out gulp-animation-states to see how you can quickly and easily combine svg and js into a single js file, allowing you to call your SVGs like any font icon.

Demos


Easing