zepto.touch
    Overview
    Reviews
    Code
    Tutorials
    Playground
    Contributors
    Issues
    Documentation
    Chat

zepto.touch

a zepto/jquery touch events plugin

1.0.3  •  Updated 4 years ago  •  by bukas  •  MIT License

a zepto/jquery touch events plugin, it provides touch events like tap,doubleTap,longTap,swipe,swipeLeft,swipeRight,swipeUp,swipeDown.

installation

use npm:

npm install zepto.touch

use bower:

bower install zepto.touch

usage

the api is the same as zepto/jquery events, but it also provides setting method, you must write the setting method $.fn.touch before the touch events, eg:

$('ul').touch({
	swipeMove: function (e, direction, distance, duration) {
		console.log(e, direction, distance, duration);
	}
}).on('swipe', 'li', function (e, direction) {
	console.log(e, direction);
}).on('tap.test', function (e) {
	console.log('tap.test');
}).on('tap', function (e) {
	console.log('tap');
	$(this).off('tap.test');
});

options

$.fn.touch.defaults = {
    fingers: 1,
    threshold: 75,
    longTapThreshold: 500,
    doubleTapThreshold: 200,
    excludedElements: 'label, button, input, select, textarea, .noTouch',
    pageScroll: true,
    swipeMove: null
};

Popularity

Stars
3

Maintenance

Development

Last ver 4 years ago
Created 4 years ago
Last commit 4 years ago
9 hours between commits

Technology

Node version: 5.1.1
0 unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

2 contributors
yuhuanzhu
12 commits
huanz
Maintainer, 7 commits
Works at Bytedance

Dependencies

Tags

touch
zepto.touch
zepto
jquery
Ready for the next level?
Join Openbase's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookLinkedIn
© 2020 Devstore, Inc.