I need a link to animate slowly on hover using jquery and this does not work

$("#link").hover(function() { $(this).animate({color: "black"}, "slow"); }, function() { $(this).animate({color: "white"}, "slow"); }); 

any suggestions? I want the link to slowly animate, and not immediately using the css hover property.

+4
source share
2 answers

You can use a "slow" smooth -

 $("#link").hover(function(){ $(this).animate({ color: '#fed900'}, "slow"); }, function() { $(this).animate({ color: '#000000'}, "slow"); }); 

Demo

+1
source
  $("#link").hover(function(){ $(this).animate({ color: '#3d3d3d'}, 4000); }, function() { $(this).animate({ color: '#000000'}, 4000); }); 

use milliseconds there.

this is animation syntax

$ (selector) .animate ({PARAMS}, speed, callback);

where the speed can be: slow / fast / millisecond

0
source

All Articles