I have a plugin like
$.fn.mycoolplugin
which binds mousemove to the document like
$(document).("mousemove", function() {
//bunch of stuff
});
after you call the function on a selector
$('.myclass').mycoolplugin();
How would I unbind this because the mousemove is bound to the document and OTHER stuff in my code uses mouseenter and mouseleave ?
You can unbind any handler by calling
.unbind:This will unbind all
mousemovehandlers fromdocument. Do note that doing this might break the plugin’s functionality (with the risk of breaking any other code/plugin that addsmousemovehandler todocument).