【问题标题】:ng-repeat + ng-animate + css3 transitionng-repeat + ng-animate + css3 过渡
【发布时间】:2015-08-24 05:56:32
【问题描述】:

当我使用 ng-animation 和 css3 过渡时,在重新初始化集合时 ng-repeat 有很大的延迟(元素从 DOM 中消失了延迟)。

我有 ng-repeat 在每次迭代时创建卡片指令:

ng-repeat="card in cards track by $index" card

card指令的根节点有一些过渡:

.card {
        transition: transform 0.2s linear;
        transform: translateX(0);
}

重新初始化卡片收集时出现问题$scope.cards = []

你知道如何解决这个问题吗?

【问题讨论】:

    标签: angularjs css-transitions delay ng-repeat ng-animate


    【解决方案1】:

    您应该对不在元素正常状态的事件使用转换。我认为如果在加载 .card 之后添加第二类 .effect 并将转换放入其中,则会发生线性转换。

    【讨论】:

      猜你喜欢
      • 2017-02-15
      • 1970-01-01
      • 2016-02-02
      • 2013-06-07
      • 2014-12-02
      • 2015-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多