我需要一个链接来使用jquery在hover时缓慢动画,这不起作用
$("#link").hover(function() { $(this).animate({color: "black"}, "slow"); }, function() { $(this).animate({color: "white"}, "slow"); });
有什么建议? 我希望链接动画缓慢而不是立即使用csshover属性。
你可以使用“慢”甚至 –
$("#link").hover(function(){ $(this).animate({ color: '#fed900'}, "slow"); }, function() { $(this).animate({ color: '#000000'}, "slow"); });
演示
$("#link").hover(function(){ $(this).animate({ color: '#3d3d3d'}, 4000); }, function() { $(this).animate({ color: '#000000'}, 4000); });
用毫秒……
这是动画的语法
$(选择器).animate({PARAMS},速度,回调);
速度可以是:慢/快/毫秒