--- In svg-developers@yahoogroups.com, Peter Thompson <[EMAIL PROTECTED]> wrote: > You can pan or zoom any element or group of elements. You can use something like this in you Up() function, which I assume is event driven, to pan the group of objects in the y direction: > > obj=SVGDoc.getElementById("to-be-updated"); > obj.setAttribute('transform','translate(0,' + change + ')';
hi thanks i tried your sugestion , it did work but the problem how can i pan more then once if you run the following code you will see that if you need to pan on the same object on the same direction you can not (you can just once ) how can i solve this problem please <svg id="SVG" width="500" height="700" onload="Initialize(evt)" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"> <![CDATA[ var SVGRoot; var SVGDoc; var translate=0; function Initialize(evt){ SVGDoc = evt.getTarget().getOwnerDocument(); SVGRoot = SVGDoc.getElementById("to-be-updated"); } function Up(dir){ if(dir == "up"){ translate=-100; SVGRoot.setAttribute('transform','translate(0,'+translate+')'); }else if(dir == "down"){ translate=100; SVGRoot.setAttribute('transform','translate(0,'+translate+')'); }else if(dir == "Right"){ translate=-100; SVGRoot.setAttribute('transform','translate('+translate+',0)'); }else if(dir == "left"){ translate=100; SVGRoot.setAttribute('transform','translate('+translate+',0)'); } } ]]> </script> <text x="100" y="55" style="font-size:30px; font-weight:bold; " onclick="zoom('in')">+</text> <text x="130" y="40" style="font-size:30px; font-weight:bold; " onclick="zoom('out')">_</text> <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/