How to get alert when user reaches the bottom of a page which is opened in bootstrap modal?
<p>I have written a script which works for the html and body section. But this script does not work for the modal when it is opened.</p>

<p>SCRIPT</p>

<pre><code> $(window).scroll(function() {
    if ($('body').height() &lt;= ($(window).height() + $(window).scrollTop())) {
       $zopim(function() {
                $zopim.livechat.button.hide();
        });
        $('.zopim').css('display','none');
//                        alert('Bottom reached!');
    }
    else{
            $zopim(function() {
                    $zopim.livechat.button.show();                  
            });
    }
});
</code></pre>

<p>This on scroll functionality works properly. I want the same thing to happen for the modal content </p>

<pre><code>&lt;div id="buildingModal" class="modal fade closeModal" role="dialog"&gt;
        &lt;div class="modal-dialog" style="width:100%;margin: 0px auto;"&gt;
           &lt;!-- Modal content--&gt;
           &lt;div class="modal-content"&gt;  
             &lt;div class="modal-body modalIframe"&gt;
               &lt;iframe id="iframe" src="abc.php" frameborder="0" width="100%"&gt;&lt;/iframe&gt;
             &lt;/div&gt;
         &lt;/div&gt;
     &lt;/div&gt;
&lt;/div&gt;
</code></pre>