/scroll-direction-detection

JavaScript function to detect user's scroll direction

Primary LanguageJavaScript

Scroll Direction Detection

Very simple JavaScript only approach to determine whether a user is scrolling ⬆️ or ⬇️

Getting Started

Copy lines 1 - 21 of scrollDirection.js and paste them into your document's <script></script> tag. Edit line 15 to apply the desired action, function, style, etc when a user scrolls up. Edit line 17 to apply the desired action, function, style, etc when a user scrolls down.

Built With

  • JavaScript

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments