2010-05-26 45 views
1

我使用这个:http://code.google.com/p/svg-edit/SVG编辑器中的硬编码内容没有出现?

我把svgcanvas DIV HTML标记内的硬编码代码:

<div id="svgcanvas"> 
    <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" id="svgroot" height="480" width="640"><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 640 480" id="svgcontent"><g style="pointer-events: all;"><title style="pointer-events: inherit;">Layer 1</title><ellipse ry="69" rx="90" style="pointer-events: inherit;" stroke-width="5" stroke="#000000" fill="#FF0000" id="svg_1" cy="156.5" cx="286"></ellipse></g></svg><g id="selectorParentGroup"><rect style="pointer-events: none;" display="none" stroke-width="0.5" stroke="#22C" fill-opacity="0.15" fill="#22C" id="selectorRubberBand"></rect></g></svg> 
</div> 

我的预期产出是应该汲取的例子SVG代码,在那里,但它没“T。即使我重新加载页面,它仍然不会显示。

我该如何让它出现?

感谢

+0

我还有一个问题:元素的绘制是否仅依赖于鼠标事件,如鼠标放下和鼠标移动?如果是这样,我不能让元素通过innerHTML出现在SVG编辑中?请回答谢谢:) – marknt15 2010-06-01 07:11:41

回答

0

最后感谢上帝,嘿嘿有人回答我的问题在SVG编辑的谷歌代码页。 这里是答案链接: Answer

感谢adeveria。

<script language="javascript"> 
$(function() { 
    setTimeout(function() { 
     stroke="#000000" stroke-width="5" style="pointer-events: inherit;" rx="30" ry="27"/></svg>'); 
     svgCanvas.setSvgString('<svg xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns="http://www.w3.org/2000/svg" id="svgroot" height="480" width="640"><svg 
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 640 480" 
id="svgcontent"><g style="pointer-events: all;"><title style="pointer-events: inherit;">Layer 
1</title><ellipse ry="69" rx="90" style="pointer-events: inherit;" stroke-width="5" stroke="#000000" 
fill="#FF0000" id="svg_1" cy="156.5" cx="286"></ellipse></g></svg><g id="selectorParentGroup"><rect 
style="pointer-events: none;" display="none" stroke-width="0.5" stroke="#22C" fill-opacity="0.15" 
fill="#22C" id="selectorRubberBand"></rect></g></svg>'); 
    }, 500); 
}); 
</script> 
+0

http://code.google.com/p/svg-edit/issues/detail?id=562 答案来源 – marknt15 2010-06-03 04:52:04