Att*_* Ch 2 javascript svg path
为什么这条路不可见?我使用javascript动态创建路径,但路径在屏幕上不可见,但它存在于DOM中.
var svg = document.getElementById('svg');
var path = document.createElementNS('http://www.w3.org/svg', 'path');
path.setAttribute('d', 'M100,100 L100,100');
path.setAttribute('style', 'stroke:black;fill:none;');
path.setAttribute('matrix', '1,0,0,1,100,100');
svg.appendChild(path);
Run Code Online (Sandbox Code Playgroud)
或者作为一个JsFiddle
| 归档时间: |
|
| 查看次数: |
2003 次 |
| 最近记录: |