如何在AngularJS 1.3 beta中使用ng-show淡入和淡出DIV的可见性? [英] How can I fade in and out the visibility of a DIV using ng-show with AngularJS 1.3 beta?
本文介绍了如何在AngularJS 1.3 beta中使用ng-show淡入和淡出DIV的可见性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码如下:
<div class="block-border"
data-ng-show="qty > 0">
xxx
</div>
我知道AngularJS中的Animation发生了很多变化.有人可以告诉我最简单的方法是,当qty的值更改时,它需要500毫秒才能显示,而50毫秒才能隐藏xxx.请注意,我正在使用最新的AngularJS.
I know there have been a lot of changes with Animation in AngularJS. Can someone tell me the easiest way for me to make it take 500ms to show and 50ms to hide the xxx when the value of qty changes. Note that I am using the very latest AngularJS.
推荐答案
-
参考angular-animate.js
Reference angular-animate.js
将ngAnimate添加为依赖模块:
Add ngAnimate as a dependent module:
var app = angular.module('app', ['ngAnimate']);
-
将类添加到您的元素中:
Add the class to your element:
<div class="block-border fade" ng-show="qty > 0">
演示: http://plnkr.co/edit/HWi0FfDOsHeSOkcrRtN2 ?p =预览
这篇关于如何在AngularJS 1.3 beta中使用ng-show淡入和淡出DIV的可见性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文