$(window).scroll(function() { if(($(document).height() - $(window).height() - $(document).scrollTop() < 50)) { } })