score:1

Accepted answer

You just forgot to split the stroke attribute setters.

Just replace

path.attr({ 'stroke-dasharray': totalLength + ' ' + totalLength, 'stroke-dashoffset': totalLength });

with

   path
     .attr('stroke-dasharray', totalLength + ' ' + totalLength)
     .attr('stroke-dashoffset', totalLength);

Edit: Running fiddle.


Related Query

More Query from same tag