title: What's wrong with this jquery animation function?
body: <pre><code>animImage('history_main_image.png');
  function animImage(img) {
      $('#slider').delay(3000).animate({opacity: 0}, 'slow', function(img) {$('#slider').css('background-image','url(images/' + img +')').animate({opacity: 1});});
  }
  </code></pre>
  
  <p>i have made it a function to animate the background in the slider element.but it doesn't work.when i check the output in chrome's inspect element option.it shows background-image:images/undefined</p>