jQuery Plugin To Track Mouse Scroll And Mobile Touch Events Swipe Trigger - Download jQuery Plugin To Track Mouse Scroll And Mobile Touch Events - Swipe-Trigger

Download jQuery Plugin To Track Mouse Scroll And Mobile Touch Events – Swipe-Trigger

Posted on

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.

jQuery Plugin To Track Mouse Scroll And Mobile Touch Events Swipe Trigger - Download jQuery Plugin To Track Mouse Scroll And Mobile Touch Events - Swipe-Trigger
File Size: 6.11 KB
Views Total: 1650
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

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() {
03     // Do something
04   },
05   swipeDown : function() {
06     // Do something
07   },
08   swipeLeft : function() {
09     // Do something
10   },
11   swipeRight : function() {
12     // Do something
13   },
14   scrollUp : function() {
15     // Do something
16   },
17   scrollDown : function() {
18     // Do something
19   }
20 });

3. Configuration options with default values.

1 $('#container').scrolltrigger({
2   last<a href="https://www.jqueryscript.net/animation/">Animation</a>   : 0,
3   quietPeriod     : 100,
4   animationTime   : 100,
5   swipeMode       : true,
6 });

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

source : jqueryscript.net