jQuery 动画持续时间就像延迟一样
jQuery animation duration acting like a delay
这是我的脚本:
greenGoButton.click(function() {
$(".road-animate").css("-webkit-animation-play-state", "running");
$(".buildings-animate").css("-webkit-animation-play-state", "running");
road.addClass('road-animate');
buildings.addClass('buildings-animate');
//THIS IS WHAT IS DELAYING
redCar.animate({ left: 1000 }, 5000);
greenCar.animate({ left: 1000 }, 5000);
//END of what I'm asking about :)
infoScreen.toggleClass('screen-two screen-three');
setTimeout(function() {screenTransition(2)} ,1500);
});
由于某种原因,REDCAR 和 GREENCAR 的动画直到 5 秒后才开始,然后它在大约半秒后快速穿过屏幕。
我试过:
redCar.stop().animate({ left: 1000 }, 5000);
greenCar.stop().animate({ left: 1000 }, 5000);
和:
redCar.animate({ left: travelDistance }, { duration: 5000, queue: false });
greenCar.animate({ left: travelDistance }, { duration: 5000, queue: false });
和:
redCar.stop().animate({ left: travelDistance }, { duration: 5000, queue: false });
greenCar.stop().animate({ left: travelDistance }, { duration: 5000, queue: false });
欧比旺克诺比帮帮我,你是我唯一的希望。 :(
我希望这是你的need.This是一个非常草率的方法。如果你找到其他方法,请避免使用它。
for(i=0;i<5;i++)
{
redCar.stop().animate({ left:+200 }, 1000);
}
哦,我的天哪,我讨厌愚蠢的事情...
我在 css 的 class 中有这个我正在制作动画:
transition: all 1.5s ease-in-out;
它覆盖了我的 jQuery 动画...删除它,它就修复了! :P
这是我的脚本:
greenGoButton.click(function() {
$(".road-animate").css("-webkit-animation-play-state", "running");
$(".buildings-animate").css("-webkit-animation-play-state", "running");
road.addClass('road-animate');
buildings.addClass('buildings-animate');
//THIS IS WHAT IS DELAYING
redCar.animate({ left: 1000 }, 5000);
greenCar.animate({ left: 1000 }, 5000);
//END of what I'm asking about :)
infoScreen.toggleClass('screen-two screen-three');
setTimeout(function() {screenTransition(2)} ,1500);
});
由于某种原因,REDCAR 和 GREENCAR 的动画直到 5 秒后才开始,然后它在大约半秒后快速穿过屏幕。
我试过:
redCar.stop().animate({ left: 1000 }, 5000);
greenCar.stop().animate({ left: 1000 }, 5000);
和:
redCar.animate({ left: travelDistance }, { duration: 5000, queue: false });
greenCar.animate({ left: travelDistance }, { duration: 5000, queue: false });
和:
redCar.stop().animate({ left: travelDistance }, { duration: 5000, queue: false });
greenCar.stop().animate({ left: travelDistance }, { duration: 5000, queue: false });
欧比旺克诺比帮帮我,你是我唯一的希望。 :(
我希望这是你的need.This是一个非常草率的方法。如果你找到其他方法,请避免使用它。
for(i=0;i<5;i++)
{
redCar.stop().animate({ left:+200 }, 1000);
}
哦,我的天哪,我讨厌愚蠢的事情...
我在 css 的 class 中有这个我正在制作动画:
transition: all 1.5s ease-in-out;
它覆盖了我的 jQuery 动画...删除它,它就修复了! :P