title: jQuery position() consistently returns 0 on every second refresh
body: <p>I have a wierd issue with jQuery which I've never seen before.</p>
  
  <p>I have a bit of script to calculate the <code>position().top</code> value of an element which is always on the page. It's an <code>li</code> inside a <code>ul</code> inside a <code>div</code>.</p>
  
  <p>The works every time I post a fresh request, normally returns <code>300</code>.
  However if I then hit <code>ctrl-r</code> and redo the request, the same code for the same page returns <code>0</code> for <code>position().top</code>. Refreshing again sees it work.</p>
  
  <p>This happens consistently, every <code>2nd</code> page refresh. However each fresh page request (with changed params or just resubmitting the form) seems to work fine. I haven't witnessed this strange failure cycle go out of sequence.</p>
  
  <h2>caveats</h2>
  
  <p>Now on to the caveats (and a bit of code):
  I'm using the <a href="http://plugins.jquery.com/project/Easing" rel="nofollow">easing</a> and <a href="http://stefangabos.ro/jquery/zebra-datepicker/" rel="nofollow">zebra_datepicker</a> plugins, and have written my own vertical slider plugin which contains the code that consistently fails to get the right position of my element.</p>
  
  <p>So I'm not expecting this to be a common occurrence, nor can I post the full source so instead I'm posting a snippet with the odd code for context more than anything else:</p>
  
  <pre><code>// inside each loop for slider parent elements
  // $(this) references the slider container, i.e &lt;div&gt;
  var slideTo = $(this).find('.slideTo').position().top; //300 or 0
  </code></pre>
  
  <p>This code is in the plugin itself, which is then called in a <code>$(window).load()</code> event.</p>
  
  <p>The way this behaves makes me think it's some kind of race condition but I can't find anything in my code that does things in the wrong sequence or runs more than once, and believe me I've filled it to the gunnels with debug.</p>
  
  <h2>tl;dr</h2>
  
  <p>So my question is this: are there any circumstances where <code>jQuery.position().top</code> will return <code>0</code>, given that the targeted element exists and has loaded by the time the call is made? </p>
  
  <p>Are there any silly mistakes I could have made to make this happen; could it be due to invalid markup or maybe something to do with the fact that the element is an <code>li</code>?</p>