js或者jquery如何获取 SVG 里面的内部对象的属性
js或者jquery怎么获取 SVG 里面的内部对象的属性
比如一个原生态的SVG对象
<svg id="svg1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cge="http://iec.ch/TC57/2005/SVG-schema#" width="5940" height="8400" viewbox="0 0 5940 8400">
<symbol id="Pole_Use" viewbox="0 0 64 64" preserveAspectRatio="xMidYMid meet" MetaW="12" MetaH="12" minL="26" minT="26">
<circle r="6" id="circle4" cx="32" cy="32" stroke="rgb(0,0,0)" fill="rgb(255,0,0)" stroke-width="1"/>
<point name="line1" x="32" y="26"/>
<point name="line2" x="32" y="38"/>
<point name="line3" x="26" y="32"/>
<point name="line4" x="38" y="32"/>
<path stroke-width="1" stroke="rgb(0,0,0)" fill="none" d="M 36,28 L 28,36"/>
<path stroke-width="1" stroke="rgb(0,0,0)" fill="none" d="M 28,28 L 36,36"/>
</symbol>
<g id="Pole_Layer">
<g id="g1">
<use id="use1" x="1927.935959" y="869.413986" width="64" height="64" transform="scale(1.5) translate(-668.645319666667 -315.804662) rotate(0 1933.935959 875.413986)" xlink:href="#Pole_Use" class=""/>
<metadata>
<cge:CN_Ref ObjectID="line42"/>
<cge:CN_Ref ObjectID="line41"/>
<cge:PSR_Ref ObjectName="03" ObjectID="Pole_3000001232762"/>
<cge:Layer_Ref ObjectName="Pole_Layer"/>
</metadata>
</g>
</g>
</svg>
这是部分代码 现在怎么 获得 <g id="g1"> 里面的 use 的 x和y
------解决思路----------------------
$("#g1").find("use").attr("x")
比如一个原生态的SVG对象
<svg id="svg1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cge="http://iec.ch/TC57/2005/SVG-schema#" width="5940" height="8400" viewbox="0 0 5940 8400">
<symbol id="Pole_Use" viewbox="0 0 64 64" preserveAspectRatio="xMidYMid meet" MetaW="12" MetaH="12" minL="26" minT="26">
<circle r="6" id="circle4" cx="32" cy="32" stroke="rgb(0,0,0)" fill="rgb(255,0,0)" stroke-width="1"/>
<point name="line1" x="32" y="26"/>
<point name="line2" x="32" y="38"/>
<point name="line3" x="26" y="32"/>
<point name="line4" x="38" y="32"/>
<path stroke-width="1" stroke="rgb(0,0,0)" fill="none" d="M 36,28 L 28,36"/>
<path stroke-width="1" stroke="rgb(0,0,0)" fill="none" d="M 28,28 L 36,36"/>
</symbol>
<g id="Pole_Layer">
<g id="g1">
<use id="use1" x="1927.935959" y="869.413986" width="64" height="64" transform="scale(1.5) translate(-668.645319666667 -315.804662) rotate(0 1933.935959 875.413986)" xlink:href="#Pole_Use" class=""/>
<metadata>
<cge:CN_Ref ObjectID="line42"/>
<cge:CN_Ref ObjectID="line41"/>
<cge:PSR_Ref ObjectName="03" ObjectID="Pole_3000001232762"/>
<cge:Layer_Ref ObjectName="Pole_Layer"/>
</metadata>
</g>
</g>
</svg>
这是部分代码 现在怎么 获得 <g id="g1"> 里面的 use 的 x和y
------解决思路----------------------
$("#g1").find("use").attr("x")