problem with jquery move image
<p>how can get x,y when mousedown in image and then mouse move in the image and then mouseup get x,y</p>

<p>(2 x,y 1-x,y when mouse down 2-x,y when mouse up)
all the event in the one image.
and language jquery</p>

<p>this my code by this not working(image stick to mouse and only mouse_d called)</p>

<p>var mx1;
var my1;</p>

<p>$("document").ready(function ()
{
    $("img#ground").bind("mousedown",mouse_d);
    $("img#ground").bind("mouseup",mouse_u);
    $("img#ground").bind("dragstart",mouse_d);
});</p>

<pre><code>      function mouse_d(event)
      {    

            mx1=event.pageX;
            my1=event.pageY;
      }

    function mouse_u(e)
    {

            mx2=e.pageX;
            my2=e.pageY;
            mx2=mx1-mx2;
            my2=my1-my2;
        }
</code></pre>
