Search code examples
javascriptmootoolsdrag

mootools:How to remove Drag?


I make the 'el' element dragable with mootools:

new Drag(el, {x1:""});//the old drag binding

Now,I want to remove the old drag binding,and then create a new drag instead.

//update the el's drag binding
new Drag(el, {x2:""});//the new drag binding

But I have no proper idea to remove the old drag binding

thanks!


Solution

  • You want to use the detach method.

    Read more about how to use it at http://mootools.net/docs/more/Drag/Drag#Drag:detach