Hello folks, I'm trying to integrate jQuery within a Rails application (instead scriptaculous+prototype) and I would like to make it unintrusive and I have already an issue with that.
I'm using fancyzoom: <a href="#small_box" id="small">Small Box!</a> <div id="small_box"> <p>Here is the contents that will appear in the zoom.</p> </div> <script type="text/javascript"> $('#small').fancyZoom(); </script> and I wish to put $('#small').fancyZoom(); within my application.js file but how can I call it when the contents are loaded? If I use $(document).ready(function() { $('#small').fancyZoom(); };) the code is executed after the DOM is loaded but before the contents are loaded so it doesn't work. THANKS FOR YOUR HELP.