Created
March 17, 2017 15:35
-
-
Save solid-pixel/76e2e55e463a6227706d2c9aadb81924 to your computer and use it in GitHub Desktop.
Target classes with Vivus JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function () { | |
// Define your callback | |
var myCallback = function () { | |
// action to execute after SVG animation is complete - optional | |
}; | |
// Get your HTMLCollection of SVG to animate | |
var myElements = jQuery(".animate svg"); | |
// Go across them to create a Vivus instance | |
// with each of them | |
for (var i = myElements.length - 1; i >= 0; i--) { | |
new Vivus(myElements[i], { | |
duration: 50, | |
type: 'async' | |
}, myCallback); | |
} | |
}); | |
// Credits: https://github.com/maxwellito |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment