Skip to main content Accessibility Feedback

Distances

window.pageYOffset

Get the distance the user has scrolled from the top of the page.

var distance = window.pageYOffset;

Works in all modern browsers, and IE9+. You can extend support back further with polyfills.