title: how to repeat jquery fadein and fadeout but avoid disappearing
body: <p>I'm trying fadein and fadeout repeatedly</p>
  
  <pre><code>&lt;img src="logo" /&gt;
  </code></pre>
  
  <p>I have this jquery to repeat the fades, but how to avoid disappearing completely, like fadeout on the halfway.</p>
  
  <pre><code>$(function () {
      var $element = $('div');
      function fadeInOut () {
          $element.fadeIn(1000, function () {
              $element.fadeOut(1500, function () {
                  $element.fadeIn(1500, function () {
                      setTimeout(fadeInOut, 500);
                  });
              });
          });
      }
  
      fadeInOut();
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/xsATz/1614/" rel="nofollow">JSFIDDLE</a></p>