【问题标题】:ng-show animation works not as expectedng-show 动画效果不如预期
【发布时间】:2014-07-11 18:12:18
【问题描述】:

我创建了this pulnker。两个进入请假动画都不好用...
enter- 首先出现,然后动画开始。
离开 - 只是不会动画。

风格如下:

   div.ng-enter 
   {
    -webkit-animation: bounceIn 2s;
    animation: bounceIn 2s;
   }
   div.ng-leave 
   {
     -webkit-animation: bounceOut 2s;
    animation: bounceOut 2s;
   }

这里是元素节点:

<div ng-show="show" ng-class="{true:'ng-enter', false: 'ng-leave'}[show]">asdasdas</div>

任何帮助将不胜感激!

【问题讨论】:

  • 你的 plunker 中的代码看起来和你这里的完全不同......
  • 在 ng-animate 上找到合适的教程。
  • 你想解决哪一个? plunker 还是这个?我已经看到了您之前的问题并已修复,但在我回答之前它已关闭。
  • 我想要这个(如问题所示)。 plunker 应该看起来像我发布的内容。我刚刚测试了链接。
  • 我在你的上一个问题中回答了这个问题。 stackoverflow.com/questions/24686950/… 见 cmets。

标签: javascript jquery css angularjs animation


【解决方案1】:

1.2.0 rc1 re-plunkered有一些变化

class="repeat-item"

并且进入/离开假定为css

.repeat-item.ng-enter, 
.repeat-item.ng-leave {...}

更多详情来自yearofmoo

这里是 ng-show 的插件:http://plnkr.co/edit/0hHjG4RQ3tQngwd814Tg?p=preview

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2017-03-12
  • 2017-04-20
  • 1970-01-01
  • 2016-01-11
  • 2014-07-24
  • 1970-01-01
  • 1970-01-01
  • 2014-12-30
相关资源
最近更新 更多