title: fadeIn and fadeOut within an infinite loop
body: <p>I have different elements under one class, I want them to fadeIn and fadeaOut randomly within an infinite loop. I can get them to fadeIn randomly now, but stuck at fading out the elements.</p>
  
  <p>And another thing is, after fadeOut, I want to delay a few second, before fading them in again.</p>
  
  <p>This is my code snippet, hope it will help.</p>
  
  <pre><code>$(document).ready(function () {
      $('.share').each(function(i){
          var rand = 1 + Math.floor(Math.random() * 7);//max of random 7 seconds
          $(this).fadeIn(rand*1000).delay(500).fadeOut(); 
      });
  });
  </code></pre>