title: Error in crossfading images using <canvas>
body: <p>I'm trying to crossfade images using the canvas drawImage() method. I'm using jQuery to fadeIn() and fadeOut() the canvas.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>$("#c").fadeOut(800,function() {
              //aw and ah are calculated here
          ctx = canvas.getContext('2d');      
          ctx.drawImage(img1, 0, 0, aw, ah);              
          $("#c").fadeIn(400);
  });
  </code></pre>
  
  <p>c is the id of the canvas. The problem is - if img1 has been viewed already, the fadeOut happens after the image has changed, i.e. first the image changes, and then the canvas fades out and back in. Am I missing something?
  Thanks</p>