Adding fadein() effect handlers to a switch background-image function in Jquery
<pre><code>&lt;script  type="text/javascript"&gt;

$(document).ready(function(){
  setInterval(spinna, 3000);


var index = 0,
   imgs = ['bg2.jpg', 'scrib.jpg'];
function spinna(){

      console.log(imgs[index]);
      $('#header_bg').fadeIn('slow',function(){
      $('#header_bg').css({   
        'background-image' : 'url(' + '&lt;?php echo get_template_directory_uri(); ?&gt;/library/images/'+ imgs[index] +'' + ')'            
      });  
   });          
    index == 0 ? index = 1 : index = 0;       
 }   
});
</code></pre>

<p>Live Code
<a href="http://gmcfosho.com/" rel="nofollow">http://gmcfosho.com/</a></p>

<p>Where am I going wrong in this code?    </p>

<p>Any help on this would be most helpful</p>
