TouchSwipe

TouchSwipe 是一个 jquery 插件,可与 jQuery 一起用于 iPad、iPhone 等触摸输入设备。「TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.」

  • 所有者: mattbryson/TouchSwipe-Jquery-Plugin
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

TouchSwipe 1.6

A jQuery plugin to be used on touch devices such as iPad, iPhone, Android etc.

Detects single and multiple finger swipes, pinches and falls back to mouse 'drags' on the desktop.

Time and distance thresholds can be set to distinguish between swipe gesture and slow drag.

Allows exclusion of child elements (interactive elements) as well allowing page scrolling or page zooming depending on configuration.

  • Detects swipes in 4 directions, "up", "down", "left" and "right"
  • Detects pinches "in" and "out"
  • Supports single finger or double finger touch events
  • Supports click events both on the touchSwipe object and its child objects
  • Definable threshold / maxTimeThreshold to determin when a gesture is actually a swipe
  • Events triggered for swipe "start","move","end" and "cancel"
  • End event can be triggered either on touch release, or as soon as threshold is met
  • Allows swiping and page scrolling
  • Disables user input elements (Button, form, text etc) from triggering swipes

Demos, examples and docs

http://labs.rampinteractive.co.uk/touchSwipe
http://labs.rampinteractive.co.uk/touchSwipe/docs

Installation

NPM

npm install jquery-touchswipe --save

Bower

bower install jquery-touchswipe --save

Manual

Include the minified file in your project.

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

Usage

$(function() {
  $("#test").swipe( {
    //Generic swipe handler for all directions
    swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
      $(this).text("You swiped " + direction );  
    }
  });

  //Set some options later
  $("#test").swipe( {fingers:2} );
});

For full demos, code examples and documentation, see below.

Development

Install dependencies

npm install

To minify

npm run minify

To build docs

npm run docs

To do both

npm run build

For port to XUI see:

https://github.com/cowgp/xui-touchSwipe

主要指标

概览
名称与所有者mattbryson/TouchSwipe-Jquery-Plugin
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证Other
所有者活动
创建于2011-06-28 11:16:26
推送于2022-08-25 10:44:07
最后一次提交2018-09-17 13:00:19
发布数21
最新版本名称1.6.19 (发布于 )
第一版名称1.0.1 (发布于 )
用户参与
星数4k
关注者数180
派生数1.7k
提交数239
已启用问题?
问题数318
打开的问题数43
拉请求数35
打开的拉请求数6
关闭的拉请求数13
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?