Remove makeDraggable

a place to get help

Moderator: 1.2 Moderators

Forum rules
  • Every time you need help create a new thread (but please use the search function before, as your problem maybe has already been solved)
  • use code highlighting (help)
  • After your problem has been solved you have to rename the subject to "[solved] <Topicname>" AND set the Topic icon as solved (the green check)

Remove makeDraggable

Postby Lo3ty on Tue Mar 02, 2010 2:32 pm

Hi

I'am Referring to this topic:
general12/clear-delete-makedraggable-function-element-t2026.html

I have a function which makes an element (given as parameter) draggable.

But to prevent that one Element gets more than one Drag instance, I want to delete all the Drag instances before adding a new one.

How is it possible to delete the Drag instance from outside the function? In my case in another function.

My code:
  1.  
  2. function remove(el)
  3. {
  4. //REMOVE DRAG INSTANCE
  5. }
  6.  
  7. function make_draggable(el)
  8. {
  9. el.makeDraggable({..............a lot of options});
  10. }
  11.  
  12. function run(el)
  13. {
  14. remove(el);
  15. //Here is an AJAX request executed
  16. make_draggable(el)
  17. }
  18.  


I tried to explain myproblem as easy as possible because the drag script is part of an very difficult calendar.

Leonhard
Lo3ty
 
Posts: 2
Joined: Mon Dec 07, 2009 6:03 pm

Re: Remove makeDraggable

Postby rollbich on Sat Mar 13, 2010 2:29 pm

hi !

I don't get the problem very well. What's the problem with your code.
You call the remove function in your run function. It should work if your remove function is OK
To remove all drag instances, you have to call the stop function as mentioned in the mootools doc.

rollbich
 
Posts: 12
Joined: Wed Nov 05, 2008 5:51 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest