How to remove $.hover event added by jQuery?
I tried $.unbind('hover'开发者_如何学Python)
, which is not working.
The hover function it's just a short-hand to bind two handlers to the mouseenter and mouseleave events, you should unbind them:
$('#item').unbind('mouseenter mouseleave');
Api documentation on hover:
Example: To unbind the above example use:
$("td").off('mouseenter mouseleave');
tringger unbinding with a click
$('.item').click(function() {
$('.item').unbind('mouseenter mouseleave');
});
You could also try:
$('#item').bind('hover', function(){return false})
精彩评论