Animated loading gif with iframes loads
===

I have this little script which displays a loading animated gif (throbber wheel) whilst my iframe is loading and then disappears when it fully loads:

     $('#mainiframe').load(function() {
        $("#loadani").addClass("nodisplay");
     });

This works great. But I was wondering if anyone knew a way to adapt this so that it works whenever a new page loads within the iframe (eg: if a user clicks a link within the iframe and navigates to a new page)?

Any advice would be great! Thanks