Running jquery once everything is loaded

Running jquery once everything is loaded

I have a page which integrates certain third-party scripts. I need to simulate a click on a certain element once these elements have been loaded.  Regular $(function(){}) doesn't work because it fires faster then these scripts load it seems.  I was able to achieve success by deferring the click event using setTimeout().  However, I was wondering if there's a more elegant way of either firing up once the page is fully parsed or once a certain element carried by those third-party scripts got loaded onto the page.  What can I do?
Thanks!
Luka