title: Move list item in method?
body: <p>I move an item in my list like so:</p>
  
  <pre><code>$('.list-item').eq(20).before('.item-to-move');
  </code></pre>
  
  <p>The above works.</p>
  
  <p>When I move the above in to a new method, it fails to work. Why?</p>
  
  <p>For example:</p>
  
  <pre><code>p.updatePos = function(){
  
      $('.list-item').eq(20).before($('.item-to-move'));
  }
  </code></pre>
  
  <p>I have logged the above method and it is called. Just for testing purposes I call it like so:</p>
  
  <pre><code>$('body').on('click', this.updatePos);
  </code></pre>
  
  <p>Also I have tried this in the method to test I am targeting right:</p>
  
  <pre><code> p.updatePos = function(){
  
      $('.list-item').hide();
      $('.item-to-move').hide();
  }
  </code></pre>
  
  <p>The above works.</p>
  
  <p>Where am I going wrong?</p>