Closed linsywu closed 6 years ago
In vanilla JS, within an event listener function you can use this
to get the instance of the Draggabilly.
var draggableElems = document.querySelectorAll('.draggable');
for ( var i=0; i < draggableElems.length; i++ ) {
var draggableElem = draggableElems[i];
var draggie = new Draggabilly( draggableElem );
draggie.on( 'dragStart', onDragStart );
}
function onDragStart() {
console.log( this.element.textContent );
}
See demo https://codepen.io/desandro/pen/fe40920fa16fa44b17b7caa0b87ea5f2
I want off this drag move event when the moveVector more than 100,but i cant'get the current draggie in the dragMove callback ,how can I get it?