TouchSwipe events are made easy, with LCweb vanilla javascript class to easily handle rollover events on-page elements. LC-Swiper is a small JavaScript (ES6) library designed to handle swipe-to-touch events on specific items.
- It gives you a swipe delta in every direction
- Supports multiple states for each item
- Features a general destructive method (targeting a specific instance)
How to make use of it:
1. Import the JavaScript file lc-swiper.js
into the document.
<script src="lc-swiper.min.js"></script>
2. Create an LC-Swiper on which you need to detect contact swipe.
<div id="targetContainer"> <h2>Swipe here!</h2> </div>
const swiper = new lc_swiper('#targetContainer');
3. Trigger a function each time you swipe on that aspect.
const swiper = new lc_swiper('#targetContainer', function(directions, $el){ // do something // directions.top // directions.right // directions.bottom // directions.left });
See Demo And Download
Official Website(LCweb-ita): Click Here
This superior jQuery/javascript plugin is developed by LCweb-ita. For extra Advanced Usage, please go to the official website.