开发者

How to remove $.hover event added by jQuery?

开发者 https://www.devze.com 2022-12-08 14:30 出处:网络
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:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消