tags:

views:

99

answers:

5

I have the following code:

$('a.home-page-link').mouseover(function() {
        $(this).animate({
            opacity:    0.4
        }, 200, function());
    });

For some reason, this refuses to "play ball", any ideas?

Cheers!

+10  A: 

Try adding {} to the second function

$('a.home-page-link').mouseover(function() {
        $(this).animate({
            opacity:    0.4
        }, 200, function() { } );
    });
Ryano
@ryano - perfect! cheers, me = stupid
Neurofluxation
+1 fast fingers :)
gnarf
A: 
$('a.home-page-link').mouseover(function() {
        $(this).animate({
            opacity:    0.4
        }, 200, function(){});
    });

make sure your callback function is declared correctly. then it should work. test it here: http://jsfiddle.net/5XwKG/

meo
A: 

Not sure if you just forgot to paste something but the third argument to .animate() - function() will throw an error as there is no function body defined: function() {} or just leave that last argument off might help.

gnarf
A: 

If you don't need the callback function, leave it out:

$('a.home-page-link').mouseover(function() {
    $(this).animate({
        opacity: 0.4
    }, 200);
});
Matti Virkkunen
A: 

Tried this? It works for me...

$(document).ready(function() 
{   
        $('a.home-page-link').mouseover(function() 
        {
            $(this).animate({opacity:0.4}, 200);
        });       
});
Cipi