title: Using JQuery to change order of elements
body: <p>Does anybody know what I'm doing wrong? I'm trying to alter the order on which some images show, I want the images to shift to the right/left one spot every time I hit a button. This is what I've tried but no luck.</p>
  
  <p>Any help or insight will be truly appreciated</p>
  
  <pre><code>$("#rightShift").click(function(){
      $("img").hide();
      var count = $("img").size();
      $("img").each(function(i) { 
          var indexImg = count - i;
          $("img:eq(indexImg)").show();
      });
  }); 
  $("#leftShift").click(function(){
      $("img").hide();
      $("img:last").prependTo("img");
      $("img").show();
  });
  </code></pre>