我正在尝试使用无限循环实现jQuery函数,以使用3种颜色为主体背景设置动画.我想不出一个漂亮而干净的解决方案.像这样的东西?
$(document).ready(function(){
$('body').animate({backgroundColor:'#ffcc00'}, 500, function(){
$('body').animate({backgroundColor:'#eeeeee'}, 500, function(){
$('body').animate({backgroundColor:'#3b5998'}, 500);
});
});
});
Run Code Online (Sandbox Code Playgroud)
任何的想法?