Hello, 

I am new to SVG and seeking for help. I have SVG document with
semi-transparent <rect> object

    <rect id="infowindow" onmousedown="pickup(evt)"
onmouseup="dropoff(evt)" onmousemove="givealift(evt)" x="626.0"
y="117.0" fill-opacity="0.4" transform="matrix(1.0 0.0 0.0 1.0 -35.0
196.0)"
         fill="#99ccff" width="240.0" filter="none" height="80.0"
stroke="#000000" rx="4" ry="4"/>


You see onmouseup, onmousemove, onmousedown attributes are assigned to
javascript functions

moving = false;

function pickup(evt){
        moving = true;
}

function dropoff(evt){
        moving = false;
}
function givealift(evt){
        if(moving)moveObject(evt);
}
function moveObject(evt) {
  var svgdoc = evt.getCurrentNode().getOwnerDocument();
  obj=svgdoc.getElementById("infowindow");
 
obj.setAttributeNS(null,"transform","translate("+evt.clientX+","+evt.clientY+")");
  }

This functions are supposed to drag rect object but clicking rect
snaps it to different position which user requires it would be. 








-----
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