This time I will share jQuery Plugin and tutorial about jQuery Plugin To Track Mouse Scroll And Mobile Touch Events – Swipe-Trigger, hope it will help you in programming stack.
Swipe-Trigger is a tiny jQuery plugin which keeps track of mouse scroll and mobile touch events and triggers certain callback functions on scroll up/down and/or swipe left/right/up/down.
How to use it:
1. Download and load the jQuery swipe-trigger plugin after you’ve loaded jQuery library.
1 |
< script src = "//code.jquery.com/jquery.min.js" ></ script > |
2 |
< script src = "js/scroll.js" ></ script > |
2. Initialize the plugin and setup the callback functions you want to trigger.
01 |
$( '#container' ).scrolltrigger({ |
02 |
swipeUp : function () { |
05 |
swipeDown : function () { |
08 |
swipeLeft : function () { |
11 |
swipeRight : function () { |
14 |
scrollUp : function () { |
17 |
scrollDown : function () { |
3. Configuration options with default values.
1 |
$( '#container' ).scrolltrigger({ |
This awesome jQuery plugin is developed by tommychoo. For more Advanced Usages, please check the demo page or visit the official website.