Disabling draggable objects

Help for using specific functions

Disabling draggable objects

Postby Tan Teow Chye » Mon May 18, 2015 1:26 am

After making an object draggable by using the function creatDraggableobject, how do I make the same object non-draggable again? I am creating a page with two objects, say A and B, and I want only one of them to be draggable at any one time. On load page, I can make A only draggable, After dragging A, I make B draggable but after this, both A and B will remain draggable.
Tan Teow Chye
 
Posts: 7
Joined: Mon May 04, 2015 1:47 am

Re: Disabling draggable objects

Postby Clifton » Mon May 18, 2015 1:30 pm

To stop an object from being dragged, just run createDraggableObject() again and set the parameter suspendDrag = true
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Disabling draggable objects

Postby Tan Teow Chye » Tue May 19, 2015 12:15 am

Thank you. I should have thought of that. I managed to solve the problem by disabling all the other draggable objects except the one to be dragged. Is this acceptable?
Tan Teow Chye
 
Posts: 7
Joined: Mon May 04, 2015 1:47 am

Re: Disabling draggable objects

Postby Clifton » Tue May 19, 2015 6:31 am

If it works, who am I to complain. Sounds great. The suspendDrag parameter was provided because not all objects respond to being disabled. Using the provided parameter will work in ALL cases.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to Function Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron