|Views Total:||2,649 views|
|Official Page:||Go to website|
|Last Update:||August 3, 2018|
Download and insert the Segment.js into your document.
Initialize a new instance on the element you want to animate.
var myPath = document.getElementById("my-path"), segment = new Segment(myPath); segment.draw("25%", "75% - 10", 1);
- begin:0 – Path length to start drawing.
- end: 100% – Path length to finish drawing.
- duration: 0 – Duration (in seconds) of the animation.
- options: null – Options for animation in object notation.
draw(begin, end, duration, options)
- delay: 0 – Waiting time (in seconds) to start drawing.
- easing: linear – Easing function (normalized).
- circular: false – If true, when the stroke reaches the end of the path it will resume at the beginning. The same applies in the opposite direction.
- callback: null – Function to call when the animation is done.
- More options and functions.