html
<a href="home.html">Home</a>
css
a {
color: blue;
}
a:hover {
color: red;
}
now as you can see <a>
now would be color red on hover.
Question
How do I remove hover via jQuery?
I have tried:
$('a').unbind('hover');
and $('a').unbind('mouseenter mouseleave')
I come to think why it won't work, is this not hover()
?
Since a:hover
is not bound event on the anchor tag and is only a pseudo class you won't have success unbinding the .hover() event.
If you want to change the behavior then you can do two things
remove the a:hover
styles
bind a hover event on the anchor tag and set the css accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With