且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在特定地点启动CSS3动画?

更新时间:2023-01-26 11:59:29

我们可以使用 animation-delay 属性。通常它延迟动画一段时间,如果你设置 animation-delay:2s; ,动画将在动画应用到元素后两秒开始。但是,你也可以使用它来强制它使用负值开始播放具有特定时间移位的动画:

We can use the animation-delay property. Usually it delays animation for some time, and, if you set animation-delay: 2s;, animation will start two seconds after you applied the animation to the element. But, you also can use it to force it to start playing animation with a specific time-shift by using a negative value:

.element-animation{
animation: animationFrames ease 4s;
animation-delay: -2s;
}

http://default-value.com/blog/2012/10/start-css3-animation-from-指定时间范围/