简体   繁体   English

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

[英]Raphael.js: How to unbind mousemove on set()?

I have this code with Raphael.js: 我在Raphael.js中有以下代码:

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

Everything works fine... but how to do unbind .mousemove event on "set" and bind again? 一切正常...但是如何unbind对“ set”的.mousemove事件bind并再次bind

Add un before the event name http://raphaeljs.com/reference.html#Element.unmousemove 在事件名称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? Raphael JS:如何删除事件?

You can't pass in an anonymous function as you did, because you have to pass a reference to the function when removing a handler 您不能像以前那样传递匿名函数,因为在删除处理程序时必须传递对该函数的引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM