tags:

views:

5009

answers:

4

Using a color plugin to animate background color on hover.

$(function(){   
$('.listing-2 li a').mouseover(function() {
 $(this).animate({ backgroundColor: "#0e7796" }, 'fast');
});
$('.listing-2 li a').mouseout(function() {
 $(this).animate({ backgroundColor: "#d6f2c5" }, 'fast');
});

});

How can I do the same for border color?

+7  A: 

Found in google

    $('.listing-2 li a').mouseover(function() {
 $(this).animate({ borderTopColor: "#0e7796" }, 'fast');
});
$('.listing-2 li a').mouseout(function() {
 $(this).animate({ borderTopColor: "#fff" }, 'fast');
});

it must be a "borderTopColor" (or left, right, bottom) instead of "borderColor".

Mike
that doesn't work
DataGreed
oops, sorry. I'm was wrong.
DataGreed
A: 

To animate the color of the entire border use:

$(this).animate({ borderTopColor: '#59b4de', borderLeftColor: '#59b4de', borderRightColor: '#59b4de', borderBottomColor: '#59b4de' }, 'fast');

Apparently, you need to specify them all.

C. Spencer Beggs
A: 

try this $(this).animate({border: "3px solid #FFF55B"}, 100);

John
A: 

ho provato con questo metodo ma a me non funziona???

darkhouse