hi this is related to another question i'm currently solving. and i found a solution. its all inside the draggable plugin if i can get a perfect answer for this question. i can update that post and share my solution. my question is how to limit draggable x or y value.
eg: if i click and drag, i want to drag only 200px left or 200px top. depend on my draggable type.
so how to get this thing done..
And for smooth animations between a moving target, like a mouse, here's a really simple formula.
currentX += (mouseX - currentX) * someRatio;
currentY += (mouseY - currentY) * someRatio;
See the Pen 65cdc21ce5c49da45709ff9d09d0a754?editors=0010 by osublake (@osublake) on CodePen