Jquery uses the unbind method to remove hover events and other methods
Source: Internet
Author: User
Today, I encountered the problem of how jquery removed hover. At first I thought that it could be done directly by unbind ("hover"), but I failed to pull it for half a day. Baidu also searched a lot about jquery's unbind for the hover event, and found the correct method on a foreigner's blog. Now I love the micro-network to share what I said on the Internet.
There are several methods for jquery to cancel a hover event::
CopyCodeThe Code is as follows:/* This method is incorrect */
$ (# Hover_div). Unbind (hover );
/* This method is also incorrect */
$ (# Hover_div). Unbind (Mouseover). Unbind (mouseout );
/* This method is newly added and cannot be used in earlier versions */
$ (# Hover_div). Unbind (mouseenter mouseleave );
/* This method is correct, and new and old versions are available */
$ (# Hover_div). Unbind (mouseenter). Unbind (mouseleave );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.