今天遇到jquery怎么去掉hover的问题,最开始以为直接unbind(“hover”)就可以搞定,可是搞了半天都失败拉。百度也搜了很多关于jquery中对hover事件unbind,后还是在一个老外的博客上看到了正确的方法,现在爱微网拿出来共享网上所说的jquery取消hover事件有以下几种方法:

代码如下:

/* 这种方法是错误的 */ 
$(#hover_div).unbind(hover); 
/* 这种方法也是错误的 */ 
$(#hover_div).unbind(mouseover).unbind(mouseout); 
/* 这种方法是新增的,在老的版本里是无法使用的 */ 
$(#hover_div).unbind(mouseenter mouseleave); 
/* 这种方法正确的,新老版本皆可用 */ 
$(#hover_div).unbind(mouseenter).unbind(mouseleave);