Reputation: 149
I have a div in prototype and it is draggable I want to make its draggable property false. How can I do it? Thanks.
<div id="answer_0_3" class="dragndrop_0 foreign dropped_answer" >Notebook</div>
My draggables are as follows:
var draggables = [];
$$('.answer.dragndrop_0').each(function(answer) {
draggables.push( new Draggable( answer, {revert: 'failure', scroll: window} ) );
});
Upvotes: 0
Views: 254
Reputation: 3422
Prototype itself does not support Draggable, but it's often coupled with Scriptaculous.
If you refer to a Scriptaculous Draggable, then you need to call it's .destroy
method:
// suppose you initialize your Draggable something like this:
var answer_0_3_draggable = new Draggable('anser_0_3', ...);
...
// later in your code
answer_0_3_draggable.destroy()
How do you initialize those Draggables anyway? Please show some more code thant your one-liner?
Upvotes: 0