Here I am

home

Path snapping in interact.js

29 Sep 2013

interact.js just got even snappier. `path` snapping now lets you set fixed axis origin points or use functions to return the points that the pointer should snap to.
paths: [{
    y: 75,
    range: Infinity
}]
paths: [function (x, y) {
    return {
        y: (75 + 50 * Math.sin(x * 0.04)),
        range: Infinity
    };
}]
paths: [function (x, y) {
    return {
        y: x % 100 < 50? 50: 100,
        range: Infinity
    };
}]