gpt4 book ai didi

jquery - jquery 动画之间的短暂延迟。为什么?

转载 作者:行者123 更新时间:2023-12-01 08:06:52 25 4
gpt4 key购买 nike

$("#car_overtake5").animate({path : new $.path.arc(arc_params)}, {duration: 2000, queue: false});
$("#car_overtake5").animate({rotate: '109deg'}, {duration: 2000, queue: true});
$("#car_overtake5").animate({"left":"9872px","top":"4872px"}, {duration: 1000, queue: true});
$("#car_overtake5").animate({rotate: '94deg'}, {duration: 250, queue: true});
$("#car_overtake5").animate({"left":"10939px","top":"4948px"}, {duration: 1000, queue: true});

一辆汽车正在赛道上行驶。但在每个动画之后,它都会停止一小会儿,然后播放下一个动画。

怎样才能让他们流畅地玩而不拖沓?

编辑:将缓动更改为线性,现在没有延迟。

最佳答案

默认缓动设置为“swing”,因此请尝试将其更改为“线性”:

$("#car_overtake5")
.animate({path : new $.path.arc(arc_params)}, {duration: 2000, queue: false, easing: "linear"})
.animate({rotate: '109deg'}, {duration: 2000, queue: true, easing: "linear"})
.animate({"left":"9872px","top":"4872px"}, {duration: 1000, queue: true, easing: "linear"})
.animate({rotate: '94deg'}, {duration: 250, queue: true, easing: "linear"})
.animate({"left":"10939px","top":"4948px"}, {duration: 1000, queue: true, easing: "linear"});

关于jquery - jquery 动画之间的短暂延迟。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16038616/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com