Hi
the following code moves the group of circles up ,down,left right
(just once )   i need to make the code more dynamic so every time he 
user clicks on the word related to an event the group sould move 
resonding to it 

thanks 




<svg id="SVG" width="500" height="700" onload="Initialize(evt)"  
xmlns="http://www.w3.org/2000/svg";>


<script type="text/javascript">
<![CDATA[


var g;
var SVGDoc;
var translate="0 0";

function Initialize(evt){
SVGDoc = evt.getTarget().getOwnerDocument();  
g = SVGDoc.getElementById("to-be-updated");
 
 
} 

function Up(dir){
    if(dir == "up"){     
    translate="0 -100";     
     g.setAttribute('transform','translate('+translate+')');        
   }else if(dir == "down"){ 
    translate="0 100"; 
    g.setAttribute('transform','translate('+translate+')');      
        
   }else if(dir == "Right"){ 
     translate="100 0"; 
    g.setAttribute('transform','translate('+translate+')'); 

    }else if(dir == "left"){ 
     translate="-100 0"; 
     g.setAttribute('transform','translate('+translate+')'); 


}

}




]]>
</script>



<text x="10" y="50" style="font-size:15px; font-weight:bold;  " 
onclick="Up('up')">up</text>
<text x="10" y="85" style="font-size:15px; font-weight:bold;  " 
onclick="Up('down')">down</text>
<text x="10" y="115" style="font-size:15px; font-weight:bold;  " 
onclick="Up('Right')">Right</text>
<text x="10" y="145" style="font-size:15px; font-weight:bold;  " 
onclick="Up('left')">left</text>


<g id="to-be-updated" >
<circle  cx="300" cy="400" r="80"  style="font-
size:l4px ;stroke:black"  />
<circle  cx="50" cy="400" r="80"  style="font-
size:l4px ;stroke:black"  />
</g>

</svg>









-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to