user1425871
user1425871

Reputation: 149

make draggable div property false in prototype

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

Answers (1)

Tharabas
Tharabas

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

Related Questions