title: Jquery fade elements one by one and remove last element if limit is exceeded
body: <p><strong>Question 1:</strong>
  I want to fade each href or img tag as they are loaded with delay, so it looks as if they are loaded separately.  I dont know which to use, <code>delay()</code> , <code>fadeToggle()</code>  or <code>fadeIn()</code> `</p>
  
  <p>At moment i get all of them using the code below, which will display in one go, every 20 second. any duplicate images are not shown as they would already be loaded in the array.</p>
  
  <pre><code> $(document).ready(function(){
          var existingElements= new Array(); // array of existing images
  
          setInterval(function(){
              $.get("/helloworld", function(data){
                  data = $.parseJSON(data);
  
                  for(i = 0; i &lt; data.length; i++){
                      if($.inArray(data[i]["id"], existingElements) == -1){
  
  
  
                         var imagelinks = '&lt;a class="removethis" href="link"&gt;'
                         +'&lt;img src="'+data[i]["img"]+'"/&gt;   &lt;/a&gt;';
  
                         $(imagelinks).prependTo("#somediv").delay(300);
  
  
                         existingElements.push(data[i]["id"]);
  
  
                          }
  
   /// add limit here, see below
                      }
                  });
              }, 20000);
          });
  </code></pre>
  
  <p><strong>Question 2:</strong>
  The div <code>somediv</code> can only have at max of 20 images. so if more than 20(exceed) images are brought in by json. i want to remove that last set images, since the above code will always bring in new images after 20 seconds, should i set a limit as follow:</p>
  
  <pre><code> if(i &gt; 20){
  $("#somediv .removethis:last").fadeOut(); // should i use remove()
  
  }
  </code></pre>