首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Css动画-动画延迟

Css动画-动画延迟
EN

Stack Overflow用户
提问于 2016-01-06 21:37:19
回答 1查看 814关注 0票数 2
代码语言:javascript
复制
Update - The pen below has been updated to show the end results.

我试图模仿使用css动画信号动画,但我似乎不能理解动画延迟的想法。如果你看这里

http://codepen.io/anon/pen/YwZOmK?editors=110

代码语言:javascript
复制
.real-time-animation {
  margin-top: 20px;
  position: relative;
  transform: scale(0.5) rotate(45deg);
  transform-origin: 5% 0%;
}

.real-time-animation>div {
  animation: sk-bouncedelay 3s infinite forwards;
}

.circle1 {
  animation-delay: 2s;
}

.circle2 {
  animation-delay: 1s;
}

@keyframes sk-bouncedelay {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.circle {
  position: relative;
  width: 16em;
  height: 16em;
  border-radius: 50%;
  background: transparent;
  border: 20px solid transparent;
  border-top-color: darkblue;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.circle2 {
  top: 40px;
  width: 12em;
  height: 12em;
  left: 33px;
}

.circle3 {
  top: 80px;
  width: 8em;
  height: 8em;
  left: 66px;
}
代码语言:javascript
复制
<div class="real-time-animation">
  <div class="circle circle1"> </div>
  <div class="circle circle2"> </div>
  <div class="circle circle3"> </div>
</div>

你应该能够理解我想要实现的目标。我想从什么都不显示开始,1秒后显示第一条,1秒后显示第二条,最后在1秒后显示第3条。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-01-06 22:06:34

我的解决方案:

http://codepen.io/anon/pen/JGWmJg?editors=110

代码语言:javascript
复制
.real-time-animation{
  margin-top: 20px;
  position: relative;
  transform: scale(0.5) rotate(45deg);
  transform-origin: 5% 0%;
}

.circle1, .circle2, .circle3{
  animation: 4s infinite ease-in;
  animation-delay: 1s;
}

.circle1{
  animation-name: circle1;
}

.circle2{
  animation-name: circle2;
}
.circle3{
  animation-name: circle3;
}

@keyframes circle1 {
  0%{ 
   opacity: 0;
  }
  
  25%{
    opacity: 0;
  }
  
  50%{
    opacity: 0;
  }
  75%{
    opacity: 1;
  }
  
  100% { 
    opacity: 0;
  }
}

@keyframes circle2 {
  0%{ 
   opacity: 0;
  }
  
  25%{
    opacity: 0;
  }
  
  50%{
    opacity: 1;
  }
  75% { 
    opacity: 1;
  }
  100%{
    opacity: 0;
  }
}

@keyframes circle3 {
  0%{ 
   opacity: 0;
  }
  
  25%{
    opacity: 1;
  }
  
  50%{
    opacity: 1;
  }
  75% { 
    opacity: 1;
  }
  100%{
    opacity: 0;
  }
}

.circle {
    position: relative;
    width: 16em; height: 16em;
    border-radius: 50%;
    background: transparent;
    border: 20px solid transparent;
    border-top-color: darkblue;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.circle2{
    top: 40px;
    width: 12em;
    height: 12em;
    left: 33px;
}

.circle3{
    top: 80px;
    width: 8em;
    height: 8em;
    left: 66px;
}

你可以改变动画持续时间的速度:“动画:4s无限轻松;

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34643273

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档