I’ve read somewhere that you can snap the object after it has been moved, but how can I incorporate that code into my own? I found this code:
stop: function(event, ui) {
t = parseInt($(this).css(top);
l = parseInt($(this).css(left);
$(this).css(top , t - t % 30);
$(this).css(left, l - l % 30);
}
But where would I put that in this:?
$('.box').draggable({grid: [10,10]}).resizable({grid: 50});
Thanks!
Have you tried snap and snapTolerance options for draggables?