Home >Web Front-end >JS Tutorial >jQuery uses unbind method to remove hover event and other methods introduced_jquery

jQuery uses unbind method to remove hover event and other methods introduced_jquery

WBOY
WBOYOriginal
2016-05-16 17:40:141236browse

Today I encountered the problem of how to remove hover in jquery. At first I thought that it could be solved by just unbind("hover"), but after a long time, it failed. Baidu also searched a lot about unbinding the hover event in jquery, and finally saw the correct method on a foreigner's blog. Now Aiwei.com has shared what is said on the Internet There are the following methods to cancel the hover event in jquery :

Copy code The code is as follows:

/* This method is wrong */
$(#hover_div).unbind(hover);
/* This method is also wrong*/
$(#hover_div).unbind(mouseover).unbind(mouseout);
/* This method is new and cannot be used in older versions*/
$(#hover_div).unbind(mouseenter mouseleave);
/* This method is correct, both old and new All versions are available*/
$(#hover_div).unbind(mouseenter).unbind(mouseleave);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn