我已经做了代码,但我希望它被重复执行,直到用户在页面上。
这是我的代码
$(document).ready(
function animate() {
$('div.lightining').stop().animate({
backgroundColor: '#789'
}, 1050, 'linear', function() { });
}
function () { $('div.lightining').cycle(animate()); }
);我希望脚本在完成后重复执行。有没有人有任何想法来实现这一点。请帮帮我!
提前感谢!
发布于 2011-03-15 20:57:48
$(document).ready( function() {
function animate() {
$('div.lightining').stop().animate({
backgroundColor: '#789'
}, 1050, 'linear', function() { animate(); });
}
animate();
});发布于 2011-03-15 21:01:18
下面的代码将连续循环动画,其中
属性是要动画化的属性
要为其设置动画的值
和持续时间。
将这些设置为您想要的任何值。
一旦动画完成,回调就会再次调用动画。
$(document).ready(function(){
animate();
});
function animate(){
$(".lightning").animate({
attribute:value
},duration,function(){
animate();
});
}不知道你说的页面上的部分是什么意思。你必须澄清这一点。另外,如果我是正确的,你不能动画背景颜色没有一个插件。
https://stackoverflow.com/questions/5311972
复制相似问题