title: get mouse position with respect to parent element
body: <p>this is my setup</p>
  
  <pre><code>&lt;div id="uxcParent"&gt;
   &lt;div id="uxcClickable"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>now when a user clicks in the inner element i want the mouse position with respect to the parent div and not the page.</p>
  
  <p>this what i tried.</p>
  
  <pre><code> var x= e.pageX- obj.offsetLeft;
   var y= e.pageY- obj.offsetTop;
  </code></pre>
  
  <p>this works fine only when i don't scroll the page. I want the function to return the same values no matter where my elements are on the same page.</p>
  
  <p><b>update</b>:</p>
  
  <p>i think it was not clear enough. am detailing more now..</p>
  
  <p>consider that the elements are in the document in x position with respect to the document. the page has a scroll bar. now i can scroll to any part of the page and the position is still going to be x. but the position with respect to the view port would have changed. so pageX and pageY will give different values. this is my catch.</p>
  
  <p>my elements can be anywhere in the view port and when i go over the inner element i should get co-ordinates with respect to the parent only(should not be influenced by where the parent is)</p>
  
  <p>hope i am clear now.</p>