1

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).

Deepu S A
  • 369
  • 3
  • 6
  • 17

3 Answers3

2

You would use the unbind() to remove an event like this:

$("selector").unbind("click");

Another method is off()

$( "p" ).off( "click", "**" );

This will remove all delegated click handlers from all paragraphs:

super
  • 2,288
  • 2
  • 21
  • 23
1

Use jQuery.unbind() or jQuery.off()

Alex Art.
  • 8,711
  • 3
  • 29
  • 47
1

Pure Javascript:

var canvas = ...;
canvas.removeEventListener('eventIDontWantAnymore', arguments.callee, false);

JSFiddle

Tyler
  • 17,669
  • 10
  • 51
  • 89