title: Get element offset().top when elements are added and removed from the page
body: <p>I have a <code>div</code> container element that can be at any position on the page. For example, a user might add my element halfway down the page, or 2/3's of the way down, or some arbitrary position. There will be content before/after/before &amp; after it.</p>
  
  <p>I need to get the <code>offset().top</code> of this but I find that this doesn't change. I have a <code>div</code> that prints a line at the point at which the offset is being calculated, but it's nowhere near the ACTUAL top of the div element.</p>
  
  <p>I'm not sure what I'm doing wrong.</p>
  
  <p>The jQuery:</p>
  
  <pre><code>var elementPos;
  $(window).load(function () {
    // Store the offset
    elementPos= $('.elementPosWrapper').offset().top;
  });
  </code></pre>
  
  <p>The basic html:</p>
  
  <pre><code>&lt;div class="elementPosWrapper" id="elementPosWrapper"&gt;
    ...
  &lt;/div&gt;
  </code></pre>
  
  <p>With other div elements that may be added before/after this. I just need to have the actual top value of the element be accurate, whether the page is 10,000px or 2,000px high.</p>