Podchaser Logo
Home
Use Javascript to calculate the length of an SVG Path

Use Javascript to calculate the length of an SVG Path

Released Monday, 10th August 2020
Good episode? Give it some love!
Use Javascript to calculate the length of an SVG Path

Use Javascript to calculate the length of an SVG Path

Use Javascript to calculate the length of an SVG Path

Use Javascript to calculate the length of an SVG Path

Monday, 10th August 2020
Good episode? Give it some love!
Rate Episode

svg is a pretty great alternative. All the techniques and basic theory here hold true; you create a path with a given length, and then set strokeDasharray and strokeDashoffset to the same length. Then you can just do path. animate({strokeDashoffset: 0}, 1000); for the same effect (1000 is time in ms).

Show More

Unlock more with Podchaser Pro

  • Audience Insights
  • Contact Information
  • Demographics
  • Charts
  • Sponsor History
  • and More!
Pro Features