Reputation: 5278
I am working on a path animation, but am stuck at how to accomplish it in reverse.
http://jsfiddle.net/t1yu3mcn/1/
Currently, the red path starts at full length, and over time becomes shorter and shorter from the right direction. I want to accomplish the same animation but where the path gets shorter starting from the left direction. (starts disappearing from the left rectangle, and ends disappearing at the right rectangle).
I have tried altering the following snippet inside .animate:
'stroke-dasharray': val + ' ' + (pathCoverLength - val)
But changing this around to different values never results in the correct effect.
Does anybody know an easy way of accomplishing this?
Upvotes: 1
Views: 977