title: Detect scroll to bottom in an iframe?
body: <p>I'm using the following event to detect if the bottom of a page is reached when scrolling :</p>
  
  <pre><code>     $(window).scroll(function() {  
         if($(window).scrollTop() == $(document).height()-$(window).height())
           alert('Bottom reached');    
         }
       });
  </code></pre>
  
  <p>This works fine on a normal page, but now I want this to work on a page that is <strong><em>inside an iframe</em></strong>. This event must be declared inside the page in the iframe.
  But <code>window</code> points to the page that contains the iframe, so I can't use that.</p>
  
  <p>Any ideas?</p>