AngularJS CSS 动画不工作

标签 angularjs css css-animations

我无法让动画仅适用于 ng-show。

这适用于淡出和淡入:

        .animate-show {
            display: block !important;
            -webkit-transition:all linear 1.5s;
            transition:all linear 1.5s;
        }

        .animate-show.ng-hide {
            opacity:0;
        }

    <div ng-show="match.userId" style="margin-right: auto; margin-left: auto;" class="padding animate-show ng-hide">
      ...
    </div>

我只想淡入......隐藏时没有动画。这行不通

       .animate-show {
            display: block !important;
        }

        .animate-show.ng-hide-remove.ng-hide-remove-active {
            -webkit-transition:all linear 1.5s;
            transition:all linear 1.5s;
        }

        .animate-show.ng-hide {
            opacity:0;
        }

这是一个 plunkr:

http://plnkr.co/edit/9KNqt5TAZ8Ejy8eeJUQs

最佳答案

.animate-show.ng-hide-remove.ng-hide-remove-active {

ng-hide-remove-active 来不及了,你只需要 ng-hide-remove

Working plunker

关于AngularJS CSS 动画不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25873072/

相关文章:

html - 访问应用程序内 html 文档内的 css 类选择器

css - 创建我的 css @-webkit-keyframes 动画的反向实例

html - 如何为整个窗口设置背景颜色(不根据内容)?见下图

javascript - 在 AngularJS 中,$scope 和 native 上下文有什么区别?

html - 文本下划线是属性吗?

html - CSS 3D变换翻转上的图像交换

css - 将显示与 css3 动画一起使用?如何在动画期间/之后隐藏/取消隐藏元素?

angularjs - 在 Angular 表达式中解码 HTML

javascript - AngularJS 使用 templateUrl 测试指令

javascript - 如何在我的 div 中而不是在我的窗口中有滚动条?