...

View Full Version : Jquery hover. How to make it work!



sorlaker
12-21-2011, 11:18 AM
<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>

The hover function isnt working.

Appreciate who can help me figure out this.

VIPStephan
12-21-2011, 11:41 AM
You can’t animate colors (at least this way), only properties with one numeric value are allowed. There is a separate color animation plugin you need to add.

venegal
12-21-2011, 11:41 AM
That anonymous function is missing parentheses:

$('img.thumb').hover(function () {

Also, jQuery doesn't animate color values you will need a plugin for that.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum