【发布时间】:2012-01-04 05:43:18
【问题描述】:
先看看:
猫需要以曲线移动到 x。 (见箭头)
当猫撞到 x 时,它应该停留 10 秒,然后猫应该回到 o,再次弯曲,并重复。
我用这段代码试了一下:
function curve() {
$('#cat').delay(10000).animate({top: '-=20',left: '-=20'}, 500, function() {
$('#cat').delay(10000).animate({top: '+=20', left: '+=20'}, 500, function() {
curve();
});
});
}
curve();
但是猫是这样移动的:
有没有办法让猫在这种曲线中移动?
【问题讨论】:
-
YUI 还提供了对弯曲动画的支持。 developer.yahoo.com/yui/examples/animation/control.html
标签: javascript jquery html jquery-animate curve