试图用css3动画连续闪烁三个元素。我已经运行了,但每帧都有淡入淡出,我想删除它。理想情况下,每个元素保持可见1秒,然后立即隐藏。css3动画硬闪烁(帧间无褪色)
我试过在0%
和99%
为opacity:1
和100%
为opacity: 0
但仍没有运气设置与帧动画。
我希望通过这种方法消除褪色!
CSS:
.motion.play .frame {
-webkit-animation-name: flash;
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: linear;
}
.frame:nth-of-type(2) {
-webkit-animation-delay: 1s;
}
.frame:nth-of-type(3) {
-webkit-animation-delay: 2s;
}
@-webkit-keyframes flash {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
感谢您的回答!了解你对填充模式和方向的看法,但看到一个步骤问题。按照你的小提琴,动画绝对有三个阶段,但它变得越来越黑暗。相反,它应该闪烁稳定的红色,绿色,蓝色而不会消失或失去亮度。如果我注释掉计时功能,它在闪烁每种颜色时效果会更好,但我希望避免100%到0的不透明度褪色。有什么想法吗? – technopeasant 2013-03-18 03:49:44
@technopeasant糟糕,我的错误。我已经更新了我的答案,请检查! – Passerby 2013-03-18 04:02:27