I am working on a page that has a dynamic list of products - when a buy button is clicked it triggers a script that delivers an iframe with a 3rd party payment system.

The page is running within a CMS so I have limited control over the current functionality and cannot add anything to the 3rd party frame.

I would like to add a loading animation that plays when a buy btn is clicked (with a class of .buyBtn) and triggers the loading anim - which is easy enough - my issue is that i need some loop or someway to detect when the iframe has loaded in the page so I can hide the loading graphic.. 

Any ideas? I thought a script containg a loop could be called when the loading gig is enabled which constantly searches for an iframe in the page would solve this - but have no idea how to code this!?

Cheers
Paul