How to delay ngAnimate in ngRepeat

前端 未结 2 968
滥情空心
滥情空心 2021-01-30 23:31

When using ngAnimate to fade in each item in ngRepeat, currently all items fade in at the same time. Is it possible for each item to fade in after the previous item has faded to

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 23:50

    You can get this effect by setting the transition-delay style on the repeated element. (Requires v1.1.5)

  • You'll have to set your transition properties separately in your CSS, otherwise the inline style will overwrite the entire transition:

    .phone-enter {
      opacity:0;
      -webkit-transition-property: all;
      -webkit-transition-timing-function: ease-out-cubic;
      -webkit-transition-duration: 400ms;
    }
    .phone-enter.phone-enter-active {
      opacity: 1;
    }
    

    Here is a fork of the example created by heyotwell.

提交回复
热议问题