【发布时间】:2015-02-04 02:40:50
【问题描述】:
当我将以下 JS 函数从 jQuery 1.4.2 更新到最新的 1.11.2 时,className Steam 不再动画。
$(window).load(function(){
function animSteam(){
$('<span>',{
className:'steam'+Math.floor(Math.random()*2 + 1),
css:{
marginLeft : -10 + Math.floor(Math.random()*20)
}
}).appendTo('#rocket').animate({
left:'-=58',
bottom:'-=100'
}, 120,function(){
$(this).remove();
setTimeout(animSteam,10);
});
}
function moveRocket(){
$('#rocket').animate({'left':'+=100'},5000).delay(1000)
.animate({'left':'-=100'},5000,function(){
setTimeout(moveRocket,1000);
});
}
moveRocket();
animSteam();
});
这是一个很酷的动画,我讨厌放弃,我不确定哪些功能已被弃用。
【问题讨论】:
-
您在调试控制台中看到任何错误吗?
标签: jquery deprecated