以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  为什么shapeObj.length=7,而不是3  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=31811)


--  作者:upc2neiep
--  发布时间:5/6/2006 12:14:00 PM

--  为什么shapeObj.length=7,而不是3
为什么shapeObj.length=7,而不是3
shapeObj 不是只有3个子节点嘛
////////////////////////////////////////////////////////////////////
<g id="shape" onclick="setShape(evt)">
  <line id="LineS" x1="40" y1="100" x2="70" y2="100" style="stroke:red;stroke-width:1"/>
  <rect id="RectS" x="40" y="110" width="30" height="10" style="fill:white;stroke-width:1;stroke:red"/>
  <circle id="CircleS" cx="60" cy="135" r="10" style="fill:white;stroke-width:1;stroke:red"/>
 </g>
/////////////////////////////////////////////////////////////////////
svgDoc=load_evt.target.ownerDocument;
shape=svgDoc.getElementById("shape");
shapeObj=shape.childNodes;
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
23.438ms