I have this function:
$( ".timebox" ).draggable({
containment: "parent",
axis: "x" ,
drag: refactorTimebox(event, ui)
});
and I want to call the function refactorTimebox(event, ui). How do I pass the event and ui variable to my function.
The line drag: refactorTimebox(event, ui) doesn’t work.
This is the refactorTimebox function:
function refactorTimebox(event, ui){
console.log(ui.position);
}
You only need to pass a reference to a function, not call it.