Micro module to get the scroll position (top or left) in the browser
Usage
Directly in the browser
Copy the content of dist/get-scroll.browser.js
into your JS file and then use it this way:
var currentScrollTop = ;var currentScrollLeft = ;
With browserify/webpack
npm install --save get-scroll
var getScroll = ; var currentScrollTop = getScrolltop; // or just getScroll()var currentScrollLeft = getScrollleft;
In ES6
; let currentScrollTop = let currentScrollLeft =
Dependencies
No dependencies.
License
MIT © Federico Brigante