how to know how many pixels of page be scrolled javascript

Solutions on MaxInterview for how to know how many pixels of page be scrolled javascript by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "how to know how many pixels of page be scrolled javascript"
Mahe
25 May 2017
1window.onscroll = function (e) {
2    console.log(window.scrollY); // Value of scroll Y in px
3};
Stefania
22 Feb 2020
1 $(window).scroll(function() {
2     // use the value from $(window).scrollTop(); 
3 });