title: Element offset is always 0
body: <p>I am using a table with a link column when the link is clicked i would like to get the offset of the row. I tried using element.offsetTop and $(element).offset().top and both return 0 the parent elements also return 0 as their offset top.</p>
  
  <p>I have tried </p>
  
  <pre><code>function getTop(element)
  {
     var top = findPosY(element);
     console.log(top); 
  }
  
  function findPosY(obj) {
     var curtop = 0;
     if (obj.offsetParent) {
        while (obj.offsetParent) {
           curtop += obj.offsetTop
           obj = obj.offsetParent;
        }
     }
     else if (obj.y)
       curtop += obj.y;
     return curtop;
  }
  </code></pre>
  
  <p>but this still return 0 for the y pos.</p>