【发布时间】:2014-10-10 16:00:19
【问题描述】:
我正在尝试使渐变淡入作为背景颜色。
$('body').animate({
background: '-webkit-gradient(linear,left top,left bottom,from(#b0c4ff),to(#6289ff)) fixed)'
}, 2000, function(){});
http://jsfiddle.net/myLf9o0j/3/
【问题讨论】:
-
您希望它从白色淡入吗?或者你想让它从一种颜色褪色到另一种颜色?如果你想让它淡入白色,只需动画元素不透明度并确保它后面有一个白色元素(通常是身体)
-
不使用
jQuery .animate()AFAIK。 -
从颜色到颜色。
-
您应该可以使用github.com/jquery/jquery-color。不过我还没玩过渐变
-
去掉'fixed'之后的')'
标签: jquery jquery-animate gradient