ngAnimate CSS animation not working with ng-show & ng-hide

放肆的年华 提交于 2019-12-06 03:17:31

Looks like correct styles should include .ng-hide-add and .ng-hide-remove:

.reveal-animation.ng-hide.ng-hide-add-active {
    display: block !important;
}
.reveal-animation.ng-hide-remove {
    -webkit-animation: enter_sequence 1s linear; /* Safari/Chrome */
    animation: enter_sequence 1s linear; /* IE10+ and Future Browsers */
}
.reveal-animation.ng-hide-add {
    -webkit-animation: leave_sequence 1s linear; /* Safari/Chrome */
    animation: leave_sequence 1s linear; /* IE10+ and Future Browsers */
}

I also had to add style for .ng-hide.ng-hide-add-active to prevent ng-hide from immediately hiding elements during animation.

Demo: http://plnkr.co/edit/HsyRYLTwcsvP9pok8BV6?p=preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!