开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜