Hey everyone,
Does anyone know if it is possible to recalculate the snap targets after a draggable has been set up?
I can sort of hack it in and modify the snap targets by overwriting them during the dragStart event, but this doesn't seem very clean and I lose the simple snap API.
Any help would be greatly appreciated!
$$
$$
interact("someEle").draggable({
snap: {
targets: [], //targets here, need to recalculate on dragStart
relativePoints: [], //rel points here
offset: {
x: 0, //canvas.offsetLeft + pageList.scrollLeft
y: 0 //canvas.offsetTop + pageList.scrollTop
}
}
});
@calebroseland , try adding
event.draggable.draggable({
snap: {
targets: [<new_target_coords>]
}
});
when you want to change target