how to get how far one has scrolled javascript code example
Example 1: how to know how many pixels of page be scrolled javascript
window.onscroll = function (e) {
console.log(window.scrollY); // Value of scroll Y in px
};
Example 2: how to know how many pixels of page be scrolled javascript
$(window).scroll(function() {
// use the value from $(window).scrollTop();
});