【问题标题】:Raphael.js: How to unbind mousemove on set()?Raphael.js:如何在 set() 上取消绑定 mousemove?
【发布时间】:2013-05-07 19:17:30
【问题描述】:

我有这个带有 Raphael.js 的代码:

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

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

【问题讨论】:

    标签: javascript raphael


    【解决方案1】:

    在事件名称前添加unhttp://raphaeljs.com/reference.html#Element.unmousemove

    // 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?

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-29
      • 2012-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多