I have draggable object in the page, and it has snap setting for the region.
<div class="drag-bound">
<div id="obj"></div>
</div>
$('#obj').draggable({
snap: ".drag-bound",
snapTolerance: 5
})
So now if $('#obj')
is dragged near the border of ".drag-bound"
, it gets snapped there.
The problem is I want $('#obj')
is snapped to the center of the ".drag-bound"
, too.
Is there any good idea how to make it happen?
Should I make custom code inside of drag
event handler?
Is there any good and easy option inside of it?