taye/interact.js — pull request #127 by taye (2014-12-10 21:18:58+00:00)
Title: Unify snap modes

```javascript
interact('*').draggable({
snap: {
targets: [
// snap to this point
{ x: 100, y: 100, range: 25 },

// give this function the x and y page coords
// and snap to the object returned
function (x, y) {
return {
x: x,
y: (75 + 50 * Math.sin(x * 0.04)),
range: 40
};
},

// create a function that snaps to a grid
interact.createSnapGrid({
x: 50,
y: 50,
range: 10, // optional
offset: { x: 5, y: 10 } // optional
})
],
// this range is used if a target doesn't specify it's range
range: Infinity
}
})

```