# super-touch

> 提供触摸事件的基础能力

Latest version **0.0.6** (published 2020-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install super-touch
pnpm add super-touch
yarn add super-touch
bun add super-touch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2020-02-24 |
| First published | 2016-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wanglei |
| Maintainers | wanglei8381 |
| Keywords | super-touch, event, touch |

## Links

- npm: https://www.npmjs.com/package/super-touch
- Repository: https://github.com/wanglei8381/super-touch
- Homepage: https://github.com/wanglei8381/super-touch#readme
- Issues: https://github.com/wanglei8381/super-touch/issues
- npm.io page: https://npm.io/package/super-touch

## Dependencies (2)

- [super-event](https://npm.io/package/super-event.md) ^0.0.1
- [dom-event-helper](https://npm.io/package/dom-event-helper.md) ^0.0.2

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2020-02-24
- 0.0.5 — 2016-12-09
- 0.0.4 — 2016-09-27
- 0.0.3 — 2016-09-27
- 0.0.2 — 2016-09-26

## README

#super-touch
 <h5>提供DOM元素基础的触摸的能力</h5>
##Install
npm install super-touch
##Use
<pre>
var Touch = require('super-touch');
var touch = new Touch(el);

touch.on('touch:start',function(res){
    res.x1 //x轴位置
    res.y1 //y轴位置
    res.e //Dom事件
    res.el //触发时间的元素
    res.timestamp //事件戳
});

touch.on('touch:move',function(res){
    res.x1 //开始触摸x轴位置
    res.y1 //开始触摸y轴位置
    res.x2 //每次滑动x轴位置
    res.y2 //每次滑动y轴位置
    res.e //DOM事件
    res.toUp //上次滑动到这次滑动是向上的吗(垂直方向)
    res.toLeft //上次滑动到这次滑动是向左的吗(水平方向)
    res.xrange //上次滑动到这次滑动的X轴距离
    res.yrange //上次滑动到这次滑动的Y轴距离
    res.spend //滑动总共花费的事件
});

touch.on('touch:end',function(res){
    res.x1 //开始触摸x轴位置
    res.y1 //开始触摸y轴位置
    res.x2 //每次滑动x轴位置
    res.y2 //每次滑动y轴位置
    res.e //DOM事件
    res.dir //滑动的方向
});

touch.on('touch:cancle',function(res){
    res.x1 //开始触摸x轴位置
    res.y1 //开始触摸y轴位置
    res.x2 //每次滑动x轴位置
    res.y2 //每次滑动y轴位置
    res.dir //滑动的方向
});

//改变绑定的DOM的元素
touch.on('touch:el',el);

//监听的window滚轴
touch.on('touch:scroll', function(e){

));
</pre>

---
_Source: https://npm.io/package/super-touch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
