- Joined
- Aug 21, 2023
- Messages
- 40
- Reaction score
- 0
Hi.
I want the div element on hover to animate to a different color via jQuery but it won't work. I know i can do this via css animations but I want it this way.I've done this way(jQuery) in another code and it worked fine.
This is in short my html:
and the script part:
and the web inspector errors:
I want the div element on hover to animate to a different color via jQuery but it won't work. I know i can do this via css animations but I want it this way.I've done this way(jQuery) in another code and it worked fine.
This is in short my html:
HTML:
<div class="services">
<div class="col-md-4" id="logodesign"><a href="contact.html">
<img src="images/LOGOSBUNDLE2.jpg" alt="logoservices" class="img-fluid">
<h1 class="blink">NEED LOGO DESIGN!</h1><p class="blink">Classic, modern, vintage, bold, ...</p></a></div></div>
and the script part:
JavaScript:
$(() => {
$('div.col-md-4#logodesign').hover(function() {
$(this).animate({
backgroundColor: '#041826',
color: '#000'
},1000)
}, function() {
$(this).animate({
backgroundColor: 'orange',
color: '#fff'
},1000);
});
});;