svg - adding use tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tino.cindric@gmail.com

    #1

    svg - adding use tag

    SVG structure

    <g id="someID" gmwmsvg:typ="l" gmwmsvg:pri="10 00">
    <g id="gwmg4" class="D5F2B3w3 j6" gmwmsvg:hi="D5F 2B3w3j6 R2v1p1o6r3">
    <use xlink:href="#D5 F2B3w3j6" x="9916" y="2711"
    gmwmsvg:act="Ja vaScript:SetFea tureID('P' + '10380');"></use>
    <use xlink:href="#D5 F2B3w3j6" x="6995" y="2834"
    gmwmsvg:act="Ja vaScript:SetFea tureID('P' + '10390');"></use>
    <use xlink:href="#D5 F2B3w3j6" x="4644" y="3775"
    gmwmsvg:act="Ja vaScript:SetFea tureID('P' + '10379');"></use>
    <use xlink:href="#D5 F2B3w3j6" x="8604" y="6546"
    gmwmsvg:act="Ja vaScript:SetFea tureID('P' + '10375');"></use>
    </g>
    </g>

    Code: (variable X,Y,sAction appropriately set)

    ele=doc.getElem entById("someID ");
    nodes=ele.getEl ementsByTagName ("g");
    ch=doc.createEl ement("use");
    ch.setAttribute ("xlink:href",n odes.item(0).ge tAttribute("cla ss"));
    ch.setAttribute ("x",X);
    ch.setAttribute ("y",Y);
    ch.setAttribute ("gmwmsvg:act", sAction);
    nodes.item(0).a ppendChild(ch);

    nothing happens - any ideas?

  • Martin Honnen

    #2
    Re: svg - adding use tag



    tino.cindric@gm ail.com wrote:
    SVG structure
    See answer in comp.lang.javas cript.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...