search

Home  >  Q&A  >  body text

angular.js - How to do some cleanup after CSS animation ends?

When studying angularjs animation, the basic method is to add some classes to control animation, such as: ng-enter, ng-enter-active, etc. But I can’t figure out how to remove these after the animation is over?

.animate-repeat{
    box-sizing:border-box;
    height:48px;
    line-height:48px;
    overflow:hidden;
}
.animate-repeat.ng-enter{
    transition:height ease-out .5s;
}
.animate-repeat.ng-enter {
    height:0;
    background:#CADFF0;
}
.animate-repeat.ng-enter.ng-enter-active {
    height:48px;
}

I think the advantage of this is to use ng-enter as an animation switch. When starting the animation, add this class and activate the animation through ng-enter-active. This method is very good, but I haven’t found how Angular removes ng-enter and ng-enter-active after the animation ends?

phpcn_u1582phpcn_u15822793 days ago574

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-15 17:00:47

    m.jb51.net/css/72443.html

    reply
    0
  • Cancelreply