How do I unbind “hover” in jQuery?

前端 未结 8 1997
醉话见心
醉话见心 2020-11-28 02:54

How do I unbind \"hover\" in jQuery?

This does not work:

$(this).unbind(\'hover\');
8条回答
  •  感情败类
    2020-11-28 03:36

    Unbind the mouseenter and mouseleave events individually or unbind all events on the element(s).

    $(this).unbind('mouseenter').unbind('mouseleave');
    

    or

    $(this).unbind();  // assuming you have no other handlers you want to keep
    

提交回复
热议问题