title: GetBoundingClientRect but relative to the entire document
body: <p>Is there a method for getting the <em>client rect</em> for an element relative to the document besides offset? <code>getBoundingClientRect()</code> gets the value relative to the client's browser.</p>
  
  <p>I'm using <code>D3</code> and <em>jQuery's</em> <code>height()</code> nor <code>width()</code> are working (I've even tried doing it <code>window.load()</code>), but <code>offset()</code> is. Neither are javascripts .offset</p>
  
  <pre><code>return [$e.offset().top + $e.height()/2, $e.offset().left + $e.width()/2]
  </code></pre>
  
  <p><code>$e.height()</code> and <code>$e.width()</code> both return <code>0</code></p>
  
  <p>It's an <em>SVG</em> element, I'm just using it to edit my <em>SVG</em>. It's much easier to load/handle SVG's with <code>D3</code>. The project is not data related, it's just a map.</p>