I am Building an HTML5 canvas javascript application. In that i am using many 'mousemouse','mousedown' event handlers each on different times. Can i remove all event handlers attached to the canvas only specifying the event 'mousemove' (with out specifying its call back function).
Asked
Active
Viewed 3,437 times
1
-
something like [`.on()/.off()`](http://api.jquery.com/off/) ? – Spokey Oct 09 '13 at 14:57
-
2I assume that "mousemouse" means "mouseup" correct ? – Venzentx Oct 09 '13 at 14:58
-
Maybe this helps: http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object – Tomasz Kapłoński Oct 09 '13 at 14:58
3 Answers
1
Pure Javascript:
var canvas = ...;
canvas.removeEventListener('eventIDontWantAnymore', arguments.callee, false);

Tyler
- 17,669
- 10
- 51
- 89
-
I think he wants to remove all events without specifying its names – Renan Cunha Nov 28 '20 at 13:03