Help needed with showing image while iframe is loading?

Help needed with showing image while iframe is loading?

Hi,

I have an <iframe> with src="". When a user clicks on a link with the class "chart" the <iframe> src will change to a URL and the URL will display in the <iframe>. However this takes a few seconds as the page being loaded is quite big. Is there any way if displaying a simple loading image while the page is being loaded into the <iframe> I'm really stuck on this one and can't find away around it.

Here is my code so far:
     $(document).ready(function(){
      
   
        var alreadyloaded;
        $('.chart').click(function(){
            if( alreadyloaded ) return;
            alreadyloaded = true;
            $('iframe.mychart').attr('src', 'chart.html');
        });


        });


Thanks in advance