Jquery : make code work when scroll to the bottom of div
<p>I found this code. It'll work when you scroll to the bottom of the whole page .
I want to change this code to detect when bottom of the div. </p>

<p>And this is the code</p>

<pre><code>    $(window).data('ajaxready', true).scroll(function(){
 if ($(window).data('ajaxready') == false) return;
if($(window).scrollTop() == $(document).height() - $(window).height())
{
    var datastring=$(".passform").last().serialize();
    $('div#loadmoreajaxloader').show();
    $(window).data('ajaxready', false);
    $.ajax({
    type: "POST",
    url: "post_update.php",
    data: datastring,
    cache   : false,
    success: function(html)
    {
        if(html)
        {
            $("#update").append(html);
            $('div#loadmoreajaxloader').hide();
        }else
        {
            $('div#loadmoreajaxloader').html('&lt;center&gt;No more posts to show.&lt;/center&gt;');
        }
        $(window).data('ajaxready', true);
    }
    });
}});
</code></pre>

<p>Thank you!</p>
