Thanks for the suggestion, however, I don't believe that would do it.
If I'm intrepreting your example in a correct way, you would stop the
'drag' only if it has been created (on mousedown). The problem is
exactly this: despite of the drag *object* being created and
programmatically started, calling drag.stop() doesn't really stop the
drag unless it is really really started (different from calling
start()) by moving mouse.

Does it sound familiar?

Tuukka



On 28 helmi, 15:32, "Steve Onnis" <[email protected]> wrote:
> 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