What is your question name suggests what you want
Subtract the value from $(document).height()about 50 to start loading 50 pixels from the bottom.
if($(window).scrollTop() <= ($(document).height() - 50) - $(window).height()){
Here is a small demonstration in jsfiddle, I made a dummy function to execute the loadMoreMabs function
http://jsfiddle.net/sg3s/UwXaw/
Fires every time you get close to the bottom and 1500 ms expire.
, ( ).
( - )
http://jsfiddle.net/sg3s/UwXaw/1/
, , >= , , , scrollTop , , ...