I have a drag and drop, for example:
$(".tab li").draggable({ revert: true, delay: 1000, opacity: .75, helper: "clone", appendTo: "body" }) .bind("dragstart", this.doSomething) .bind("dragstop", this.undoSomething);
So, after a second hold of the mouse, drag and drop can begin. This works fine while you move the mouse after 1 second. Immediately after moving the mouse, the dragstart event is dispatched, as it should be. I want dragstart to start after 1 second, even if you do not drag the mouse.
I know I can do this with:
.bind("mousedown", this.setSomeIntervalAndWait)
but I need access to the ui.draggable element, which is created as part of draggable (), so the mousedown / mouseup solution will not do.
Is it possible without changing jQueryUI to trigger a delay event instead of a mouse movement? I can hack something together without problems using timeouts, cloning an object, positioning it and deleting it on dragstart, but I hope for something less confusing.
source share