onscroll = function(){
var scrollHeight = Math.max(
document.body.scrollHeight, document.documentElement.scrollHeight,
document.body.offsetHeight, document.documentElement.offsetHeight,
document.body.clientHeight, document.documentElement.clientHeight
);
if(window.scrollY+1 >= scrollHeight - innerHeight) alert('Конец прокрутки');
};
рони,