如何在jQuery中向上滑动并向下滑动?

use*_*752 4 javascript jquery jquery-mobile

你能告诉我如何在jQuery + jQuery mobile中刷卡和向下滑动.

我已经使用过这个插件: 如何向上滑动JQuery mobile

缺点:当我滚动内容时,它会调用上下滑动功能.您能否提供最佳解决方案,以便我能够滚动我的内容并使用jQuery或jQuery mobile上下滑动.

Ved*_*Ved 9

https://github.com/mattbryson/TouchSwipe-Jquery-Plugin下载

添加到您的html页面

<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"
});
Run Code Online (Sandbox Code Playgroud)

或试试这个https://github.com/watusi/jquery-mobile-iscrollview