在原型中使draggable div属性为false

时间:2012-06-11 13:17:42

标签: prototypejs draggable

我在原型中有一个div,它是可拖动的我想让它的draggable属性为false。我该怎么做?感谢。

<div id="answer_0_3" class="dragndrop_0 foreign dropped_answer" >Notebook</div>

我的可拖动内容如下:

var draggables = [];
$$('.answer.dragndrop_0').each(function(answer) {
      draggables.push( new Draggable( answer, {revert: 'failure', scroll: window} ) );
});

1 个答案:

答案 0 :(得分:0)

Prototype本身不支持Draggable,但它通常与Scriptaculous结合使用。 如果您引用Scriptaculous Draggable,则需要将其称为.destroy方法:

// 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()

你怎么初始化那些Draggables?请显示一些代码的更多代码吗?