2010-05-26 42 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