jquery trigger scroll position code example
Example 1: jquery keep scroll position
var scroll = $(window).scrollTop();
// yada
$("html").scrollTop(scroll);
Example 2: jquery trigger event when scroll to div
$(window).scroll(function() {
var hT = $('#scroll-to').offset().top,
hH = $('#scroll-to').outerHeight(),
wH = $(window).height(),
wS = $(this).scrollTop();
if (wS > (hT+hH-wH)){
console.log('H1 on the view!');
}
});