window.onscroll = function (e) { console.log(window.scrollY); // Value of scroll Y in px };
$(window).scroll(function() { // use the value from $(window).scrollTop(); });