I have this code:
grabbale.addEventListener("leap-hand-grab", function(e){
if (e.state === "grab") {
console.log("grabbed");
} else if (e.state === "release") {
console.log("release");
} else if (e.state === "move") {
if (stopGrab == 0) {
grabbale.style.left = e.x - (grabbale.offsetWidth/2)+ "px";
grabbale.style.top = e.y - (grabbale.offsetHeight/2)+ "px";
} else {
$("#foo").css({
"color": "red"
});
}
}
})
what I need is to remove eventListener using removeEventListener, but it require two arguments, the event and the function. In my case the function haven't a name, and the event is the drag of grabbale element... How can I do what I need?