2017-05-03 70 views
2

我试图从angularjs文档重现NG-显示动画简单的NG-显示动画不工作

<div class="v3-account-form animate-show-hide" ng-show="thing.shown"> 
    <h3>{{thing.id}}</h3> 
</div> 

的CSS:

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

.animate-show-hide.ng-hide-add, 
.animate-show-hide.ng-hide-remove { 
    transition: all linear 0.5s; 
} 

.v3-account-form { 
    border: 1px solid black; 
    opacity: 1; 
} 

但动画是不是在这里工作是小提琴。 http://jsfiddle.net/ffKTy/527/

+0

赞[this](http://jsfiddle.net/ffKTy/528/)?请注意,您需要在您的应用中包含[ngAnimate](https://docs.angularjs.org/api/ngAnimate) –

回答

1

您没有在您的小提琴ngAnimate中导入。正如你在角度Plunker中看到的那样,有必要使那里的显示动画起作用。

<script src="//code.angularjs.org/snapshot/angular.min.js"></script> 
<script src="//code.angularjs.org/snapshot/angular-animate.js"></script> 
+0

我的小提琴仍然无法使用http://jsfiddle.net/ffKTy/531/ – Petran