How do I unbind “hover” in jQuery?

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

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

This does not work:

$(this).unbind(\'hover\');
相关标签:
8条回答
  • 2020-11-28 03:53

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

    or more succinctly (thanks @Chad Grant):

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

    0 讨论(0)
  • 2020-11-28 03:54

    Another solution is .die() for events who that attached with .live().

    Ex.:

    // attach click event for <a> tags
    $('a').live('click', function(){});
    
    // deattach click event from <a> tags
    $('a').die('click');
    

    You can find a good refference here: Exploring jQuery .live() and .die()

    ( Sorry for my english :"> )

    0 讨论(0)
提交回复
热议问题