You can extract the scroll position using jQuery’s .scrollTop()
method
$(window).scroll(function (event) {
var scroll = $(window).scrollTop();
// Do something
});
More Related Contents:
- Scroll Function working in reverse order [closed]
- How to disable scrolling temporarily?
- Smooth scrolling when clicking an anchor link
- Scroll Automatically to the Bottom of the Page
- How to scroll an HTML page to a given anchor
- Prevent scrolling of parent element when inner element scroll position reaches top/bottom?
- Prevent BODY from scrolling when a modal is opened
- Smooth scroll to div id jQuery
- How to scroll to specific item using jQuery?
- event.wheelDelta returns undefined
- Scroll smoothly to specific element on page
- prevent Scroll bubbling from element to window
- How to do a horizontal scroll on mouse wheel scroll?
- How to load images dynamically (or lazily) when users scrolls them into view
- Fade In on Scroll Down, Fade Out on Scroll Up – based on element position in window
- Stop fixed position at footer
- javascript: detect scroll end
- How can I differentiate a manual scroll (via mousewheel/scrollbar) from a Javascript/jQuery scroll?
- Synchronized scrolling using jQuery?
- jQuery jump or scroll to certain position, div or target on the page from button onclick [duplicate]
- jQuery live scroll event on mobile (work around)
- prevent touchstart when swiping
- Javascript: do an action after user is done scrolling
- How to determine scroll direction without actually scrolling
- ScrollTo function in AngularJS
- jQuery – bind event on Scroll Stop
- Choppy/Laggy scroll event on Chrome and IE
- Scrolling Overflowed DIVs with JavaScript
- Load ajax when scroll reaches 80%
- Automatically scroll down chat div