How to cancel and restore hover events in jquery.
Can hover written in css be canceled and restored?
天蓬老师2017-06-14 10:55:46
hover is a simple version of mouseenter mouseleave, you can just write like this
$("td").bind("mouseenter mouseleave",handlerInOut);
$("td").unbind("mouseenter mouseleave",handlerInOut);
过去多啦不再A梦2017-06-14 10:55:46
Let’s talk about canceling and restoring hover in CSS, it’s actually very simple
For example, corresponding to a p, you can write the hover effect in CSS and define it on a class, and then add this class to p through jquery to achieve the hover effect. If you want to cancel, then directly add this Just remove the class.
Examples are as follows:
http://runjs.cn/detail/ez5qogoo
phpcn_u15822017-06-14 10:55:46
$(this).addClass("focus").css("pointer-events","none");
I found the answer. It can also be done by adding a pointer-events event. I think this is the simplest