title: How to read coordinates of a DIV while it is being dragged ? (Javascript)
body: <p>I want to read the coordinates of a &lt;div&gt; while it is being dragged and compare it to a static &lt;div&gt; and if at all their positions intersect each other while dragging, it should show some message. I want to accomplish this on web using jquery or javascript. Thanks in advance.</p>
  
  <p>code might be something like this (just a random code)</p>
  
  
  
  <pre><code> function onDivDragged(e){
  
  
       var elemOffset=$("#"+e.target.id).offset();
         var elem2Offset=$("#elem2Id").offset();
  
        if(parseInt(elem2Offset.top.replace("px",""))==parseInt(elemOffset.top.replace("px","") &amp;&amp;  parseInt(elem2Offset.left.replace("px",""))==parseInt(elemOffset.left.replace("px","")))
         {
         alert("intersection occurred");
         }
  
  }
  </code></pre>