jQuery Plugin To Determine Scroll Down/Up Events - ScrollDetector

File Size: 9.72 KB
Views Total: 1260
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Determine Scroll Down/Up Events - ScrollDetector

ScrollDetector is an ultra-light, cross-browser jQuery plugin that detects the scroll events and triggers callbacks when the users scroll the webpage down or up.

How to use it:

1. Just include the jQuery scrolldetector plugin's script after jQuery library and we're ready to go.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jqueryscrolldetector.js"></script>

2. The JavaScript to execute a callback when the user scrolls down.

$(document).on('scrollUp',function(){ //define a custom event listener
  alert("up");
});

3. The JavaScript to execute a callback when the user scrolls up.

$(document).on('scrollDown',function(){ 
  alert("down");
});

This awesome jQuery plugin is developed by phpust. For more Advanced Usages, please check the demo page or visit the official website.