let bottomOfWindow = ((window.pageYOffset || window.scrollY || document.documentElement.scrollTop) + window.innerHeight) >= (document.documentElement.offsetHeight - this.trigger)
var $win = $(window);
var $marker = $('#marker');
$win.scroll(function() {
if($win.scrollTop() + $win.height() >= $marker.offset().top) {
$('#message').html('конец');
}else{
$('#message').html('не конец');
}
});