获取所有的SVG并加上相应的样式
var svgElement = $('svg.jtk-connector');
console.info(svgElement,'svgElement')
var pathElement = svgElement.find('path:first');
pathElement.attr('class', 'connector-line');
pathElement.attr('fill', 'transparent');
pathElement.attr('stroke', '#1890ff');
pathElement.attr('stroke-dasharray', '5');
pathElement.attr('animation', 'flow-line 5s infinite linear');
.connector-line {
stroke: #1890ff;
stroke-dasharray: 5;
animation: flow-line 5s infinite linear;
fill: transparent;
/* 设置填充为透明 */
}
@keyframes flow-line {
0% {
stroke-dashoffset: 500;
}
100% {
stroke-dashoffset: 0;
}
}

这样就可以让流程图中间的连线动起来
流程图样式
该代码段展示了如何选取SVG中的连接线元素,并添加特定样式使其产生动画效果。通过设置`stroke-dasharray`和`@keyframes`实现线条流动的动画,赋予流程图更生动的表现力。
3958

被折叠的 条评论
为什么被折叠?



