You could add this to the handle of the drag object

el.addEvent("mouseup", function () {if(drag) {drag.stop()});

-----Original Message-----
From: Tuukka Mustonen [mailto:[email protected]] 
Sent: Tuesday, 1 March 2011 12:06 AM
To: MooTools Users
Subject: [Moo] How to programmatically stop Drag?

I create an initialize Drag by:

var drag = new Drag.Move(el, {...});
drag.start(event);

If I move mouse after this, the drag gets really initiated (and
onStart called). At some point I can simply call:

drag.stop();

And dragging stops as supposed.

However, if I start the drag as above, but don't move the mouse before
calling drag.stop() (for example through a timer), drag.stop() doesn't
really stop the drag (it gets initiated when I move the mouse).

How to kill a start()ed drag before mouse is moved?

Reply via email to