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.
hover is a simple version of mouseenter mouseleave, you can just write like this
$("td").bind("mouseenter mouseleave",handlerInOut);
$("td").unbind("mouseenter mouseleave",handlerInOut);
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
jquery doesn’t seem to be able to select pseudo classes, right?
$(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