In the below fiddle I have interact Js to snap the children element to a certain point.
But I am having trouble snapping all sides of the blue div to snap to center and x & y axis of the parent div.
JsFiddle: https://jsfiddle.net/n3wLb5vp/1/
Below is my snap code:
modifiers: [
interact.modifiers.snap({
targets: [
{ x: 195, range: 20 },
{ y: 228, range: 20 }],
relativePoints: [{
x: 0,
y: 0
}]
})]
Could you please help me figure out snap function for achieving that functionality?