How to get xy coordinate but not starts from window browser, instead starts from div?
<p>Aloha all!!</p>

<p>I have a problem here...Im using jquery here..n using visual studio 2008..I need to find the coordinate of an image after being drag n drop in a div.But what I had got is that the coordinate counts from out of div..I want it counts from inside the div..  </p>

<p>Please...anyone??</p>

<p>Here's my code:</p>

<pre><code>    $('#dragThis').draggable({
    cursor: 'move',        // sets the cursor apperance
    containment: '#dragThis2',
    drag: function() {
    var offset = $(this).offset();
    var xPos = Math.abs(offset.left);
    var yPos = Math.abs(offset.top);
    $('#posX').text('x: ' + xPos);
    $('#posY').text('y: ' + yPos);
    },
    stop: function(event, ui) {

    // Show dropped position.
    var Startpos = $("#dragThis").position();
    var Stoppos = $(this).position();

    $("#dragThis2").val((Stoppos.left - Startpos.left));
    var left = Math.abs(Stoppos.left);
    var top = Math.abs(Stoppos.top);
    $('#posX').text('left: ' + left);
    $('#posY').text('top: ' + top);
    }

   });
</code></pre>
