Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以画一条线raphael.js,逐渐增加它的宽度。
raphael.js
它将以例如 的笔划宽度开始,以的2px结束。stroke-width10px
2px
stroke-width
10px
有人知道该怎么做吗?
是的,这很简单。给定一个 Raphael 纸元素paper和路径字符串pathstr,只需执行以下操作:
paper
pathstr
var linepath = paper.path( pathstr ).attr( { stroke: 'black', fill: 'none', 'stroke-width': 2.0 } ).animate( { 'stroke-width': 10.0 }, 5000 );
除非我在您的请求中遗漏了某些内容,否则这真的很容易。