Jump to content
Search Community

joachim

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by joachim

  1. Hi,

     

    is there a way to preserve all an elements attributes and just exchange the Ids ?

     

    I translate and rotate both g collections and at some point I want to exchange ONLY the elements Ids,

     

    0g becomes 1g and 1g becomes 0g, how can I do this ?

     

    This does not work:

     

    exchangeElms(gArray[0].id, gArray[1].id);

     

    function exchangeElms(param1, param2){
          var temp = param1;
          param1 = param2;
          param2 = temp;
        };

     

    <svg .......

    <g id= "0g">

         <rect class="base bring2" x=  "0" y=  "0" /> 

         <rect class="dring2" x= "25" y= "25" width= "75" height= "75" />

    </g>

    <g id= "1g">

         <rect class="base bring2" x="100" y=  "0" /> 

         <rect class="dring2" x="100" y= "25" width="100" height= "75" />

    </g>

    </svg>

×
×
  • Create New...