javascript AngularJS ngAnimate ngView 平滑淡出/淡入动画
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19001315/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AngularJS ngAnimate ngView smooth fade out/in animation
提问by MR.ABC
i like to have a nice transition while i change the content of my ngView. The user can always change the active view faster than the animation. Is there a way to always get an smooth fade out/in animation. The only way that is visible to seems to ignore fadeout/leave.
我喜欢在更改 ngView 的内容时有一个很好的过渡。用户总是可以比动画更快地更改活动视图。有没有办法始终获得平滑的淡出/淡入动画。可见的唯一方法似乎忽略了淡出/离开。
回答by Daiwei
Try this http://plnkr.co/edit/NO0Xqh?p=preview.
试试这个http://plnkr.co/edit/NO0Xqh?p=preview。
With JavaScript controlled animation, it will make sure when user clicks faster than the animation, the value animation stop in the middle and reverse back to initial states.
使用 JavaScript 控制的动画,它会确保当用户点击速度快于动画时,值动画会停在中间并返回初始状态。