jquery 滚动到底部时自动加载更多

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

var loading = false;
$(window).scroll(function ()
{
    if ((($(window).scrollTop() + $(window).height()) + 250) >= $(document).height())
    {
        if (loading == false)
        {
            loading = true;
            $('#loadingbar').css("display", "block");
            $.get("load.php?start=" + $('#loaded_max').val(), function (loaded)
            {
                $('body').append(loaded);
                $('#loaded_max').val(parseInt($('#loaded_max').val()) + 50);
                $('#loadingbar').css("display", "none");
                loading = false;
            }
            );
        }
    }
}
);
 
$(document).ready(function ()
{
    $('#loaded_max').val(50);
}
);