In this jsFiddle I have two SVG rects.
(在这个jsFiddle中,我有两个SVG 矩形 。)
The first one inside an SVG tag, the second one rendered with Raphael JS. (第一个在SVG标签内,第二个用Raphael JS渲染。)
Both rects should be identical with double borders, but they are not. (两个矩形均应使用双边框,但不相同。)
Using node.setAttribute
in Raphael JS is supposed to set the low level SVG attribute, so this should work. (node.setAttribute
在Raphael JS中使用node.setAttribute
来设置低级SVG属性,因此这应该可以工作。)
What's missing here? (这里缺少什么?)
<svg height="100" width="100">
<rect class="rect2" height="50" width="50" x='25' y='25' />
</svg>
<div id="the_canvas"></div>
.rect2 {
fill: none;
outline: 2px double black;
outline-offset: 0;
}
var w = 100, h = 100;
var paper = Raphael("the_canvas", w, h);
var rect = paper.rect(25,25,50,50);
rect.node.setAttribute('fill', 'none');
rect.node.setAttribute('outline','2px double black');
rect.node.setAttribute('outline-offset', 0);
ask by ps0604 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…