Created
August 17, 2016 22:01
-
-
Save jugalpatel803/6034cc0b1b13d284b078d95316fb86f9 to your computer and use it in GitHub Desktop.
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
| var totalLength = path.node().getTotalLength(); | |
| path | |
| .attr("stroke-dasharray", totalLength + " " + totalLength) | |
| .attr("stroke-dashoffset", totalLength) | |
| .transition() | |
| .duration(2000) | |
| .ease("linear") | |
| .attr("stroke-dashoffset", 0); | |
| svg.on("click", function(){ | |
| path | |
| .transition() | |
| .duration(2000) | |
| .ease("linear") | |
| .attr("stroke-dashoffset", totalLength); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment