Raphael.js:如何在set()上取消绑定mousemove?

时间:2013-05-07 19:17:30

标签: javascript raphael

我有Raphael.js的代码:

var set = paper.set();
// ... here push some elements to set: path, circles, etc.
set.mousedown(function() { ... });
set.mousemove(function() { ... });
set.mouseup(function() { ... });

一切正常......但是如何在“设置”和unbind再次发生.mousemove bind事件?

1 个答案:

答案 0 :(得分:0)

在事件名称http://raphaeljs.com/reference.html#Element.unmousemove

之前添加un
// Pass the handler to install it
set.mousemove(handler);
// Pass the same handler to remove it
set.unmousemove(handler);

Raphael JS : how to remove events?

您不能像传入的那样传入匿名函数,因为在删除处理程序时必须传递对函数的引用