动画不适用于animation-iteration-count:1(或除无限之外的任何数字)

时间:2016-03-17 05:19:24

标签: css css-animations

animation-iteration-count:无效工作完全正常,但当我将计数更改为数字时,动画将完全停止工作。

请检查下面的代码,任何帮助都会很棒。

HTML:

<div  class="guidDisplay slideIn"></div>

CSS:

.guidDisplay {
  font-weight: 600;
  padding-left: 30px;
  color: white;
  width: 100%;
  -webkit-animation: slideIn ease-in 1;
  animation: slideIn ease-in 1;
  -webkit-animation-fill-mode: forwards;
  animation-fill-mode: forwards;
  -webkit-animation-duration: 750ms;
  animation-duration: 750ms;
}

.slideIn {
  -moz-animation: bounce 2s infinite;
  -webkit-animation: bounce 2s infinite;
  animation: bounce 2s infinite;
}

@-moz-keyframes slideIn {
  0% {
    -moz-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
  50% {
    -moz-transform: translate3d(50%, 0, 0);
    transform: translate3d(50%, 0, 0);
  }
  100% {
    -moz-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@-webkit-keyframes slideIn {
  0% {
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
  50% {
    -webkit-transform: translate3d(50%, 0, 0);
    transform: translate3d(50%, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes slideIn {
  0% {
    -moz-transform: translate3d(-100%, 0, 0);
    -ms-transform: translate3d(-100%, 0, 0);
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
  50% {
    -moz-transform: translate3d(50%, 0, 0);
    -ms-transform: translate3d(50%, 0, 0);
    -webkit-transform: translate3d(50%, 0, 0);
    transform: translate3d(50%, 0, 0);
  }
  100% {
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

当我从bounce 2s infinite)更改动画时 到bounce 2s 1,如果我包括,动画也会停止工作 animation-iteration-count:1。,它不起作用。

0 个答案:

没有答案