Skip to content Skip to sidebar Skip to footer

Jquery: Unbind Jquery 2.0 On Method

In jQuery 1.9 live() was deprecated, so the new method became: $(document).on('mouseover','*',blahblahfunc); I'm unable to unbind 'blahblahfunc'. via $('*').unbind('mouseover mou

Solution 1:

use .off()

see the Api Documentation

http://api.jquery.com/off/

The off() method removes event handlers that were attached with .on()

$(document).on("mouseover","*",blahblahfunc);
$(document).off("mouseover","*",blahblahfunc);

Solution 2:

The opposite of $("selector").on(...) is $("selector").off(...). See http://api.jquery.com/off/ Hope that helps.

Solution 3:

You bound the event to the document, therefore you have to unbind it from the document.

$(document).off("mouseover","*",blahblahfunc);

Post a Comment for "Jquery: Unbind Jquery 2.0 On Method"