How to remove $.hover event added by jQuery?

前端 未结 4 1840
萌比男神i
萌比男神i 2020-12-14 05:37

I tried $.unbind(\'hover\'), which is not working.

相关标签:
4条回答
  • 2020-12-14 06:11

    Api documentation on hover:

    Example: To unbind the above example use:

    $("td").off('mouseenter mouseleave');
    
    0 讨论(0)
  • 2020-12-14 06:17

    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');
    
    0 讨论(0)
  • 2020-12-14 06:20

    You could also try:

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

    0 讨论(0)
  • 2020-12-14 06:32

    tringger unbinding with a click

    $('.item').click(function() { 
     $('.item').unbind('mouseenter mouseleave');
    });
    
    0 讨论(0)
提交回复
热议问题