css - 动画 ionic 滑动列表

标签 css angular ionic-framework ionic2 ionic3

目前我正在使用我的滑动 ionic 列表的一些动画,例如从左向右滑入以及根据本教程淡入的内容。 https://www.joshmorony.com/how-to-create-animations-with-css-in-ionic/

@-webkit-keyframes animateInPrimary {
  0% {
    -webkit-transform: translate3d(-100%,0,0);
  }

  100% {
    -webkit-transform: translate3d(0,0,0);
  }
}

@-webkit-keyframes animateInSecondary{

  0% {
    opacity: 0;
  }

  50% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.animate-in-primary {
    -webkit-animation: animateInPrimary;
    animation: animateInPrimary;
    -webkit-animation-duration: 750ms;
    animation-duraton: 750ms;
}

.animate-in-secondary {
    -webkit-animation: animateInSecondary ease-in 1;
    animation: animateInSecondary ease-in 1;
    -webkit-animation-duration: 750ms;
    animation-duraton: 750ms;
}

现在我想让 ionic 元素一个接一个地滑动。我想我必须使用 css 属性 -webkit-animation-delay。但我不确定在哪里插入它。希望有人能帮忙。谢谢, 阿什莉

最佳答案

如果你想用 CSS 动画来做到这一点,那么你需要做的是为每个列表项添加一个增量类,然后相应地错开你的动画,如下所示:CSS Animations with delay for each child element

更简单的方法是使用动画模块的内置交错功能 - 看看这篇文章:https://coursetro.com/posts/code/78/Creating-Stagger-Animations-in-Angular-4#

关于css - 动画 ionic 滑动列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45488056/

相关文章:

css - 你知道有什么工具可以从外部/内部样式表切换到内联样式吗?

angular - Angular 组件中的链式自定义管道

angular - 根据值隐藏和显示元素 Angular 2

angularjs - 将支付网关与 IONIC 集成

ios - 通过使用 Ionic 单击按钮隐藏键盘 ios

angularjs - Ionic - 单击后退按钮时重新加载并在 ng-repeat 中显示新数据

html - 每次应用 "break-word"时,有没有办法用符号替换一行的最后一个字母?

html - 垂直对齐打破文本下划线

angular - Karma 断开连接,因为 10000 毫秒内没有消息

javascript - 如何强制定位元素停留在浏览器可见区域内?