JQuery hover - How to make background color animation
<div class="post_each">
<h1 class="post_title">Apartamentos 1 comodo</h1>
<img class="thumb" src="1.jpg"/>
<img class="thumb" src="1.jpg"/>
<img class="thumb" src="1.jpg"/>
<img class="thumb last" src="1.jpg"/>
</div>
<div class="post_each">
<h1 class="post_title">Apartamentos 2 comodo</h1>
<img class="thumb" src="1.jpg"/>
<img class="thumb" src="1.jpg"/>
<img class="thumb" src="1.jpg"/>
<img class="thumb last" src="1.jpg"/>
</div>
<script type="text/javascript">
$('img.thumb').hover(function {
$(this).animate({"background" : "white"}, 600);
});
</script>
hover () doesn't work at all. I'm just trying to set either the background color or the border size should be increased on hover.
+5
user1124927
source
share3 answers
$('img.thumb').hover(function(){
$(this).animate({ backgroundColor: 'white' }, 600);
});
jQuery backgroundColor animation jQuery animate backgroundColor
0