JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE8+).
Features include:
- inertia and snapping
- multiple interactions
- cross browser and device, supporting the desktop and mobile versions of Chrome, Firefox and Opera as well as Internet Explorer 8+
- interaction with SVG elements
- being lightweight and standalone (not yet another jQuery plugin)
- not modifying the DOM except to support IE8 and to change the cursor (but you can disable that)
Installation
- Bower:
bower install interactjs
- npm:
npm install interactjs
- Direct download the latest version: http://interactjs.io/#download
- jsDelivr CDN:
<script src="//cdn.jsdelivr.net/interact.js/1.2.6/interact.min.js"></script>
- cdnjs CDN:
<script src="//cdnjs.cloudflare.com/ajax/libs/interact.js/1.2.6/interact.min.js"></script>
(replaceVERSION
with the SemVer you want to use)
Documentation
Visit http://interactjs.io/docs for the API documentation.
Example
var pixelSize = 16; // draw colored squares on move // clear the canvas on doubletap ; { forEach; } // interact.js can also add DOM event listeners ; ;
See the above code in action at http://codepen.io/taye/pen/YPyLxE
License
interact.js is released under the MIT License.