今天用jquery写hover事件,临时遇到个需求需要遇到特定条件能够取消hover事件,但是使用
$("a").unbind("hover");
起不到任何作用,最后在stackover上查到解决办法:
$("a").unbind('mouseenter mouseleave');
在jquery的官方文档上有这方面的说明: jQuery documentation
本文探讨了在jQuery中遇到特定条件时无法取消hover事件的现象,并提供了使用mouseenter和mouseleave替代的方法。同时引用了jQuery文档中的相关说明。
今天用jquery写hover事件,临时遇到个需求需要遇到特定条件能够取消hover事件,但是使用
$("a").unbind("hover");
起不到任何作用,最后在stackover上查到解决办法:
$("a").unbind('mouseenter mouseleave');
在jquery的官方文档上有这方面的说明: jQuery documentation

被折叠的 条评论
为什么被折叠?