Leem
Leem

Reputation: 18308

Raphael.js How to remove click handler?

If I have append a click event handler function to my Raphael element like this:

var paper = Raphael("mycanvas", '100%', '100%');


var clickHandler = function(){
     //DO SOME THING
}

var myRect = paper.rect(140, 10, 30, 30);
myRect.click(clickHandler);

How to remove this click handler later?

I tried myRect.click(), I suppose it will empty my click handler function, and will remove my previous click handler for myRect, but it does not.

So, How to remove this click handler later?

Upvotes: 2

Views: 1898

Answers (1)

Wolfgang Kuehn
Wolfgang Kuehn

Reputation: 12926

Please try myRect.unclick(clickHandler);

Upvotes: 5

Related Questions