Code Monkey home page Code Monkey logo

etouch's Introduction

基于微积分算法的手势库

具备功能 tap手势,实时监控滑动距离,支持链式的上下左右滑回调

  • 2016/2/22 重大更新, 为了精确预判用户行为,通过手指划过的曲线面积,使用微积分算法,极大提高精确度
  • 感谢 Appian 提供的算法

普通示例地址!戳我戳我戳我 15-10-27

仿聊天列表,item可左右滑动示例 16/2/22

高级事件,给div加锁 16/2/22

移动端日历实战 16/2/22

新增没有支持CMD和AMD版本,在使用avalon自带加载器过程中,有支持的版本无法使用

举个粒子

//事件代理例子 !!!!!第一个参数仅支持id!!!!!!
支持复杂选择器代理
etouch('#pox','.ul li span',function(e,touch) {
	e.clock = true;  //给div加锁,完全阻止默认事件
	console.log('我仅仅只是一个tap啊!');
	console.log(touch);
}).on('swiper',function(e,touch) {
	console.log('实时获取');
}).on('up',function(e,touch) {
	console.log('上滑回调');
}).on('down',function(e,touch) {
	console.log('下滑回调');
}).on('left',function(e,touch) {
	console.log('左滑回调');
}).on('right',function(e,touch) {
	console.log('右滑回调');
});
//直接事件批量绑定
 etouch('li',function(e,touch) {
 	console.log(this,e,touch);
 }).on('left',function() {
 
})
 //  e为事件对象,touch为触摸返回对象

还支持 CMD 和 AMD

require(['etouch'],function(etouch) {
	
	new etouch('#box',function(e) {
		console.log('box');
	});
	
})

etouch's People

Contributors

meckodo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

etouch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.