Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to swipe up and swipe down in jQuery?

Can you please tell me how how to swipe up and swipe down in jQuery + jQuery mobile.

I already use this plugin: How to swipe top down JQuery mobile

Demerit: When I scroll the contents it calls swipe up and down function. Can you please give best solution so that I will able to scroll my content and swipe up and down using jQuery or jQuery mobile.

like image 878
user2648752 Avatar asked Jan 11 '23 22:01

user2648752


1 Answers

Download from https://github.com/mattbryson/TouchSwipe-Jquery-Plugin

Add in your html page

<script src="js/jquery.touchSwipe.min.js"></script>

$("#id").swipe( {
  swipeUp:function(event, direction, distance, duration) {
    //console.log("You swiped " + direction)
  },
  swipeDown:function(event, direction, distance, duration) {
    //console.log("You swiped " + direction) 
  },
  click:function(event, target) { 
  },
  threshold:100,
  allowPageScroll:"vertical"
});

OR try this one https://github.com/watusi/jquery-mobile-iscrollview

like image 181
Ved Avatar answered Jan 21 '23 10:01

Ved