如何删除jQuery添加的$ .hover事件?

时间:2009-10-13 05:41:25

标签: jquery events

我尝试$.unbind('hover'),但无效。

4 个答案:

答案 0 :(得分:75)

hover函数只是short-hand将两个处理程序绑定到mouseentermouseleave事件,您应该取消绑定它们:

$('#item').unbind('mouseenter mouseleave');

答案 1 :(得分:11)

Api documentation on hover

示例:要取消绑定上面的示例,请使用:

$("td").off('mouseenter mouseleave');

答案 2 :(得分:2)

点击取消绑定点击

$('.item').click(function() { 
 $('.item').unbind('mouseenter mouseleave');
});

答案 3 :(得分:-2)

您也可以尝试:

$('#item').bind('hover', function(){return false})