Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 1.27 KB

README.md

File metadata and controls

50 lines (39 loc) · 1.27 KB

Smart Touch

Smart Touch is an easy to use Javascript- Touch- Libary.

Changelog

Note: You could use it without jQuery.

Install

  • cd <your_project_root_folder>
  • npm install smart-touch --save

Examples

Use this code before every example

Add to your HTML:

<!-- only for test cases! -->
<script src='https://rawgit.com/mulian/smart-touch/master/dist/boundle.js' language='javascript' type='text/javascript' />
// will add touch globaly to window.touch
// require('smart-touch'); //if you use browserify

var call = function(e) {
  console.log(e);
}

Move two fingers from right edge (like Mac OS > show Notifications)

touch.on().fingers.eq(2).from.right().call(call);

Move three fingers to Top (like Mac OS show Mission Control)

touch.on().fingers.eq(3).move.toTop().call(call);

Move one or more fingers from left edge (like windows switch Apps)

touch.on().fingers.betweene(1,5).from.left().call(call);

Pinch in with four Fingers (like Mac OS > show Launchpad)

touch.on().fingers.eq(4).pinch.in().call(call);

Documentation

HERE