Fade in image after laod?

Fade in image after laod?

Hi,

I try to get an image to fade in after it has been loaded, but I can't get it to work. This is how the code look with
the loading part:

$("#bild1").click(function(){
    $("#main_image").attr("src","bild1.jpg");  
});

After the image is loaded, I want it to fade in. How is that done? I have tried to add fadeIn but not working. Preciate som help. Thanks!