代码片段:
dashArray[0] = i;
dashArray[1] = (100 - i);
dashOffset = i * 2;
if (this.localName === 'path') {
$(this)
.attr('stroke', 'rgba(' color.join(',') ')')
.attr('stroke-dasharray', dashArray.join(','))
.attr('stroke-dashoffset', dashOffset);
} else {
$(this)
.attr('stroke', 'rgba(255,255,255,' color[3] ')')
.attr('stroke-dasharray', dashArray.join(','))
.attr('stroke-dashoffset', dashOffset);
}