javascript - How to cancel and restore hover events in jquery
女神的闺蜜爱上我
女神的闺蜜爱上我 2017-06-14 10:53:46
0
4
1033

How to cancel and restore hover events in jquery.
Can hover written in css be canceled and restored?

女神的闺蜜爱上我
女神的闺蜜爱上我

reply all(4)
Peter_Zhu

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梦

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?

phpcn_u1582

$(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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!