1

与CSS:

.show-left-menu {
  -webkit-animation-name: leftSidebarAni;
  -webkit-animation-duration: .25s;
  -webkit-animation-timing-function: ease-out;
  -webkit-animation-iteration-count: 1; 
}

@-webkit-keyframes leftSidebarAni {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
  }
  80% {
    -webkit-transform: translate3d(84%, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(79%, 0, 0);
  }
}

我如何让一个带有“show-left-menu”类的 div 留在最后(100%)阶段?

4

1 回答 1

0

您必须添加-webkit-animation-fill-mode: forwards;.show-left-menuCSS。

CSS:

.show-left-menu{
    -webkit-animation-name: leftSidebarAni;
    -webkit-animation-duration: .25s;
    -webkit-animation-timing-function: ease-out;
    -webkit-animation-iteration-count: 1; 
    -webkit-animation-fill-mode: forwards;
}
于 2013-10-29T16:16:34.803 回答